DIV Pops not working for Netscape/Mozilla etc... -- only IE

J

John

I have some essential pop-up menus that open fine in IE but not in
other browsers (or operating systems, i.e. Linux). Any ideas?


function toggleNAVIG(szDivID, iState) // 1 visible, 0 hidden
{
if(document.layers) //NN4+
{
document.layers[szDivID].visibility = iState ? "show" : "hide";
}
else if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById(szDivID);
obj.style.visibility = iState ? "visible" : "hidden";
}
else if(document.all) // IE 4
{
document.all[szDivID].style.visibility = iState ? "visible" :
"hidden";
}
}

Thanks!
 
M

Mick White

John said:
I have some essential pop-up menus that open fine in IE but not in
other browsers (or operating systems, i.e. Linux). Any ideas?


function toggleNAVIG(szDivID, iState) // 1 visible, 0 hidden
{
How are you calling the function, and in which version of NN does it
fail, and what is the error message (if any) ?

Mick

if(document.layers) //NN4+
{
document.layers[szDivID].visibility = iState ? "show" : "hide";
}
else if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById(szDivID);
obj.style.visibility = iState ? "visible" : "hidden";
}
else if(document.all) // IE 4
{
document.all[szDivID].style.visibility = iState ? "visible" :
"hidden";
}
}

Thanks!
 
L

Lasse Reichstein Nielsen

I have some essential pop-up menus that open fine in IE but not in
other browsers (or operating systems, i.e. Linux). Any ideas?

No, not from that description.

What goes wrong? Any error messages? In which browsers? On which page?

The code looks fine (except that it will probably fail in OmniWeb ...
I would test for getElementById first).
document.layers[szDivID].visibility = iState ? "show" : "hide";

You can use "visible" and "hidden" in Netscape 4 too.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top