[thelist] NN6.2 Javascript or CSS problem

Hardacker, Andrew Andrew.Hardacker at Compuware.com
Tue Feb 19 12:51:00 CST 2002


I've had the same problem when trying to make a collapsible outline widget
from a table. I dislike browser-specific code but this worked for me:

// assume isNN6 is a boolean variable set in some sniffer code
thingy.style.display = isNN6 ? "" : "inline";

You probably don't need to set visibility if you're already setting display.

I'm in digest mode, so if you have problems with this suggestion, write
directly. Or wait.

Andy Hardacker
andrew.hardacker at compuware.com

> <snippet>
> function showServices() {
>  document.getElementById("intro").style.display="none";
>  document.getElementById("intro").style.visibility="hidden";
>  document.getElementById("softwareTD").style.backgroundColor="#FFFFFF"
>  document.getElementById("software").style.display="none";
>  document.getElementById("software").style.visibility="hidden";
>  document.getElementById("linksTD").style.backgroundColor="#FFFFFF"
>  document.getElementById("links").style.display="none";
>  document.getElementById("links").style.visibility="hidden";
>  document.getElementById("servicesTD").style.backgroundColor="#FFCC00"
>  document.getElementById("services").style.display="inline";
>  document.getElementById("services").style.visibility="visible";
>  }
> </snippet>



More information about the thelist mailing list