Forum Moderators: not2easy
How is your script currently working? As opposed to posting the full script (it hurts my eyes!), maybe a brief outline of the logic involved.
From that we can work towards a solution for NN4.x compatibility.
BTW, have you looked at the dHTML menu system in the JavaScript Jumpstart #3 [webmasterworld.com]? It's NN4.x compatible and might give you an idea of making your script the same...
Hope this is enough to show you what I am doing.
Many thanks,
Robin.
NZ
<script type="text/javascript">
function MouseOver_PullDown1()
{
if (document.getElementById)
{
document.getElementById('pulldown1').style.visibility='visible';
}
else if (document.all)
{
document.all['pulldown1'].style.visibility='visible';
}
}
function MouseOut_PullDown1()
{
if (document.getElementById)
{
document.getElementById('pulldown1').style.visibility='hidden';
}
if (document.all)
{
document.all['pulldown1'].style.visibility='hidden';
}
}
// -->
</script>
Could you please give me an example how to do this. I do not know whether I should add another "if" or "else if" conditional statements. What JS method should I use for NN4?
I enclose some sample code for NN4, which I cannot fathom how to manipulate and incorporate into my own script.
Many thanks,
Robin
New Zealand.
<script language="JavaScript">
<!--
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
// Show/Hide functions for non-pointer layer/objects
function show(id) {
if (ns4) document.layers[id].visibility = "show"
else if (ie4) document.all[id].style.visibility = "visible"
}
function hide(id) {
if (ns4) document.layers[id].visibility = "hide"
else if (ie4) document.all[id].style.visibility = "hidden"
}
//-->
</SCRIPT>
I have tried several experiment using else if conditional statements to try to get the visibility:visible - visibility:hidden to be recognised in Netscape 4.7.
My variable nn4 appears to be working as my alert test shows “true1” and “true2” when I execute my script in NN 4.7 and “false1” - “false2” in Explorer and NN 7.1, as I would expect. So it certainly looks like I am on the right track.
It appears then, that my problem lies somewhere in the style sheet layers attributes within my functions.
Could you please give some suggestions as to what I should add to my script so that I can succeed in getting the visibility to work in NN 4.7 My script is presented below.
Many thanks,
Regards,
Robin
New Zealand.
<script type="text/javascript">
nn4 = (document.layers)? true:false //variable for Netscape Communicator 4.7
function MouseOver_PullDown1()
{
if (document.getElementById)
{
document.getElementById('pulldown1').style.visibility='visible';
}
else if (document.all)
{
document.all['pulldown1'].style.visibility='visible';
}
else if (nn4) //Netscape Communicator 4.7
{
document.pulldown1[nn4].visibility='visible';
}
}
alert(nn4 + '1')
function MouseOut_PullDown1()
{
if (document.getElementById)
{
document.getElementById('pulldown1').style.visibility='hidden';
}
else if (document.all)
{
document.all['pulldown1'].style.visibility='hidden';
}
else if (nn4) //Netscape Communicator 4.7
{
document.pulldown1[nn4].visibility='hidden';
}
}
alert(nn4 + '2')
// -->
</script>
<style type="text/css">
<!--
#menu {position:absolute; left:90px; top:40px; width:80px; border:1px red solid; z-index:2; background:#ff6600}
#pulldown1 {position:absolute;left:90px; top:70px; width:80px; border:1px red solid; z-index:1; background:#ffff33; visibility:hidden}
-->
</style>