SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing a div's visibility in NS4

    I've been having all kinds of problems doing this.
    What I have now is:

    document.elementname.visibility = "visible";

    but that throws up an error, saying the elementname has no properties. Can any javascript guru's lend me a hand?

  2. #2
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heres the code im using, if that helps:

    PHP Code:
      function showhide(divname,state) {

    if (
    document.layers) {
      
    doc "document.";
      
    sty "";
    }
    else if (
    document.all) {
      
    doc "document.all.";
      
    sty ".style";
    }

    else if (
    document.getElementById) {
      
    doc "document.getElementById('";
      
    sty "').style";
    }

    element = eval(doc divname sty);
    element.visibility state;


  3. #3
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind. I figured it out


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •