P
Paul Nash
This is a dropdown menu script thats works ok in IE but is not positioning
properly in Firefox. m.style.pixelLeft and Top are being set to the right
values. But the menu, in a div block, is being displayed as though the
pixelLeft and Top are being ignored.
<script type='text/javascript' >
var cm=null;
document.onclick = new Function("show(null)")
function getPos(el,sProp) {
var iPos = 0
while (el!=null) {
iPos+=el["offset" + sProp]
el = el.offsetParent
}
return iPos
}
function show(el,m) {
if (m) {
m.style.pixelLeft = getPos(el,"Left")
m.style.pixelTop = getPos(el,"Top") + el.offsetHeight
m.style.display='';
}
if ((m!=cm) && (cm)) cm.style.display='none'
cm=m
}
</script>
.. . .
<a href='page?page=gifts' class='menulink'
onmouseover='show(this,menu_gifts);' >
Gifts
</a>
.. . .
<!-- MENU BOX for gifts -->
<div id='menu_gifts' class='submenu' style='display: none;' >
<!-- start of imagebox -->
<table cellspacing='0' cellpadding='0' border='0'>
<tbody>
.. . .
Regards, Paul Nash
properly in Firefox. m.style.pixelLeft and Top are being set to the right
values. But the menu, in a div block, is being displayed as though the
pixelLeft and Top are being ignored.
<script type='text/javascript' >
var cm=null;
document.onclick = new Function("show(null)")
function getPos(el,sProp) {
var iPos = 0
while (el!=null) {
iPos+=el["offset" + sProp]
el = el.offsetParent
}
return iPos
}
function show(el,m) {
if (m) {
m.style.pixelLeft = getPos(el,"Left")
m.style.pixelTop = getPos(el,"Top") + el.offsetHeight
m.style.display='';
}
if ((m!=cm) && (cm)) cm.style.display='none'
cm=m
}
</script>
.. . .
<a href='page?page=gifts' class='menulink'
onmouseover='show(this,menu_gifts);' >
Gifts
</a>
.. . .
<!-- MENU BOX for gifts -->
<div id='menu_gifts' class='submenu' style='display: none;' >
<!-- start of imagebox -->
<table cellspacing='0' cellpadding='0' border='0'>
<tbody>
.. . .
Regards, Paul Nash