Layer menu problem

M

Mika

Hi!

I have been coding some kind of layer menu system with JavaScript. The
following code works fine with IE 5.5, Opera 7.11 and Netscape 7.0 but
Netscape 4.7 hides the drop down menu (= div layer) every time when I
move the mouse pointer over it.

Can you help me?

Mika


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Home Page</title>

<script language="JavaScript" type="text/javascript">
<!--

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for
(i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById(n);
return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
var kutsuja, i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if
((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

function nayta(layeri)
{
layeri == "mainmenu01" ? MM_showHideLayers('mainmenu01','','show')
: piilota('mainmenu01');
}

function piilota(layeri)
{
MM_showHideLayers(layeri,'','hide');
}

//-->
</script>

<style type="text/css"><!--

#mainmenu01 { position: absolute; left: 236px; top: 45px; visibility:
hidden; z-index: 15; }

//-->
</style>

</head>

<body bgcolor="#0F5790">

<center>

<a href="index.html"onmouseout="MM_swapImgRestore();
piilota('mainmenu01');" onmouseover="MM_swapImage('home', '',
'buttons/home_on.gif', 1); nayta('mainmenu01')"><img
src="buttons/home_on.gif" width="58" height="24" alt="Home" title="Home"
border="0" name="home"></a>

<div id="mainmenu01" style="z-index: 15;"
onmouseover="nayta('mainmenu01');" onmouseout="piilota('mainmenu01');">
<a href="page2.html"><img src="page2_off.gif" width="160" height="24"
alt="Page 2" border="0"></a><br>
<a href="page3.html"><img src="page3_off.gif" width="160" height="24"
alt="Page 3" border="0"></a>
</div>

</center>

</body>
</html>
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top