Web Analytics Made Easy -
StatCounter div tag causes table to disapear in ie - CodingForum

Announcement

Collapse
No announcement yet.

div tag causes table to disapear in ie

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • div tag causes table to disapear in ie

    I am attempting to make a page that has various sections that can be viewed by clicking a button. Im using css to hide and unhide div tags containg the content, but, when using IE, anything in a table isn't redrawn after the div is hidden, then set back to visible.
    The code works fine in firefox.
    The stripped down code is something like this:

    <html>
    <head>
    <script language="JavaScript">
    function setVisibility(id, visibility) {
    document.all[id].style.visibility = visibility;
    if (visibility == "hidden") {
    document.all[id].style.position = "absolute";
    document.all[id].style.display = "none";
    }
    else if (visibility == "visible") {
    document.all[id].style.position = "relative";
    document.all[id].style.display = "block";
    }
    }

    function visibleById(id) {
    setVisibility("contentA", "hidden");
    setVisibility("contentB", "hidden");
    setVisibility("contentC", "hidden");
    setVisibility(id, "visible");
    }
    </script>
    </head>
    <body>
    <img src="img/a.gif" onClick="visibleById('contentA');">
    <img src="img/b.gif" onClick="visibleById('contentB');">
    <img src="img/c.gif" onClick="visibleById('contentC');">
    <div id="contentA" style="visibility:hidden; position:absolute">
    stuff
    <table><tr><td>cluck</td></tr></table>
    </div>
    <div id="contentB" style="visibility:hidden; position:absolute">
    more stuff
    <table><tr><td>bark</td></tr></table>
    </div>
    <div id="contentC" style="visibility:visible; position:relative">
    even more stuff
    <table><tr><td>meow</td></tr></table>
    </div>
    </body>
    </html>

    the actual page can be found at:
    http://www.snow.edu/~luisg
    i appreciate any help
    thanks

    ~army
Working...
X