SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: css switch

  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css switch

    Code:
    function change() {
    
    if (newsbox.style.visibility == "visible")
     {
    newsbox.style.visibility="hidden";
    announce.style.visibility="visible";
    announceimg.style.visibility="visible";
     }
    
    else
     {
    newsbox.style.visibility="visible";
    announce.style.visibility="hidden";
    announceimg.style.visibility="hidden";
     }
    }
    Works in IE, mozilla says newsbox is not defined. any ideas?
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Which element is defined as "newsbox"?

    If you need to, then add this code to the beginning of your function, before the if statements:
    Code:
    var newsbox = document.getElementById("newsbox");
    var announce = document.getElementById("announce");
    var announceimg = document.getElementById("announceimg");


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
  •