SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JavaScript Hide Content not working in IE7

    Hi javascript gurus,

    Got a little problem with my javascript not working in IE7. ive pasted the code below.

    basically there is some buttons on the page, and when you click on buttons it reveals the content related to that button. it works fine in FF & chrome, but IE7 doesnt seem to do anything. there doesnt appear to be any errors showing up either.

    Would really appreciate if anyone could help out. really really appreciate it

    thanks in advance!


    Code:
    function HideContent() {//hide all open layers first
    	document.getElementById('help1').style.display = "none";
    	document.getElementById('help2').style.display = "none";
    	document.getElementById('help3').style.display = "none";
    	document.getElementById('help4').style.display = "none";
    	document.getElementById('help5').style.display = "none";
    	document.getElementById('help6').style.display = "none";
    	document.getElementById('help7').style.display = "none";
    	document.getElementById('help8').style.display = "none";
    }
    function ShowContent(d) {
    document.getElementById(d).style.display = "block";
    }
    function ReverseDisplay(d) {
    if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; document.location.href="#"+d;
     }
    else { document.getElementById(d).style.display = "none"; }
    }
    function BackToTop() {
    	document.location.href="#top";
    }

  2. #2
    SitePoint Addict
    Join Date
    Oct 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed

    it was because i had a name's with the same id as the content to show/hide


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
  •