Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

images and links in layers

Status
Not open for further replies.

tomothy

Technical User
Oct 30, 2001
40
GB
I have written the below code to display a drop down menu when you run over a link. The layer displays and when the mouse runs out of the layer the layer disappears. When I have a link or a image in the layer running over the link or image is considered to be moving out of the layer and the layer closes. How can i prevent this?

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#FFFFFF&quot;>
<p>

<a href=&quot;something.html&quot; onmouseover=&quot;SubMenu('MenuExpand')&quot;>Here</a> </p>
<div onmouseout=&quot;HideSubMenu('MenuExpand')&quot; id=&quot;MenuExpand&quot; style=&quot;position:absolute; width:200px; height:115px; z-index:0; visibility:hidden&quot;>
<img src=&quot;test.jpg&quot;>
<br>
<a href=&quot;test.htm&quot;>Sub menu link 2</a>
<br>
<a href=&quot;test.htm&quot;>Sub menu link 3</a>
</div>
<p>&nbsp; </p>

<SCRIPT language=&quot;JavaScript&quot;>

function SubMenu(layerID)
{
if (document.all)
{
document.all[layerID].style.visibility=&quot;visible&quot;
}
}
function HideSubMenu(layerID)
{
if (document.all)
{
document.all[layerID].style.visibility=&quot;hidden&quot;
}
}


</SCRIPT>
</body>
</html>

thank you for you time

Andrew Wieland
 
Maybe you meant it to be that way, but that is IE 4 compatible only. If you are not using IE 4, it should not work. If you aren't using IE 4, replace &quot;document.all[...]&quot; with &quot;document.getElementById('...')&quot;.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top