charon
01-14-2003, 07:17 AM
hi ,
I use e very simple way for creating my mouseover menu, that is using <div> tag and css. below is my code:
function showMenu(id)
{
if(!supported)
return;
if (supported)
obj = (dom) ? document.getElementById(id) : document.all(id)
//the absolute position display differently in IE and Nestcape, so need to reposition
if(dom2){
obj.style.left=100
obj.style.top = 555
obj.style.visibility='visible';
}
obj.style.visibility='visible';
}
function hideMenu(id)
{
if(!supported)
return;
if (supported)
obj = (dom) ? document.getElementById(id) : document.all(id)
obj.style.visibility='hidden';
}
#ampmenu {position:absolute; margin-left:125px; margin-top:-244px; visibility:hidden}
/ I add an animation gif file here...
<table></tr><td>
<div id="ampmenu" onMouseOver=showMenu("ampmenu") onMouseOut=hideMenu("ampmenu")>
Link1
Link2
Link3
</div>
</tr></td>
Everything going well, except, when I change the height of the layout page, for instance add a small animation before the LINK (Link1, Link2 and Link3), the menu not display in the original posistion, I need to change the margin-top of the layer when the height of the layout is changed, WHY???????
Please advice!
I use e very simple way for creating my mouseover menu, that is using <div> tag and css. below is my code:
function showMenu(id)
{
if(!supported)
return;
if (supported)
obj = (dom) ? document.getElementById(id) : document.all(id)
//the absolute position display differently in IE and Nestcape, so need to reposition
if(dom2){
obj.style.left=100
obj.style.top = 555
obj.style.visibility='visible';
}
obj.style.visibility='visible';
}
function hideMenu(id)
{
if(!supported)
return;
if (supported)
obj = (dom) ? document.getElementById(id) : document.all(id)
obj.style.visibility='hidden';
}
#ampmenu {position:absolute; margin-left:125px; margin-top:-244px; visibility:hidden}
/ I add an animation gif file here...
<table></tr><td>
<div id="ampmenu" onMouseOver=showMenu("ampmenu") onMouseOut=hideMenu("ampmenu")>
Link1
Link2
Link3
</div>
</tr></td>
Everything going well, except, when I change the height of the layout page, for instance add a small animation before the LINK (Link1, Link2 and Link3), the menu not display in the original posistion, I need to change the margin-top of the layer when the height of the layout is changed, WHY???????
Please advice!