
April 17th, 2004, 09:46 AM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 138
Time spent in forums: < 1 sec
Reputation Power: 5
|
|
|
youngpup.net slideout menu. Positions fine in IE but not mozilla :(
Hi, ive managed to get this slide out menu positioned correctly in IE even when the user changes res/resizes the window using this script:
PHP Code:
<SCRIPT language=javascript type=text/javascript>
function relocate() {
ref = document.getElementsByTagName('table')[0]
refL= ref.offsetLeft; refT = ref.offsetTop;
if(navigator.appName == "Microsoft Internet Explorer")
//alert('blah')
refs = [ refT+118, m1=refL+21, m2=m1+65, m3=m2+81, m4=m3+78, m4+90]
if (navigator.appName == "Netscape")
//alert('blah2')
refs = [ refT+10, m1=refL+233, m2=m1+65, m3=m2+81, m4=m3+84, m4+90]
divs = document.getElementsByTagName('div')
count = 0
for(i=0; i<divs.length; i++) if(divs[i].id.indexOf('Container')+1) count++;
for(var i=1; i<=count; i++) {
obj = document.getElementById("menu"+i+"Container")
obj.style.left = refs[i] + 'px'
obj.style.top = refs[0] + 'px'
}
}
window.onload = relocate
window.onresize = relocate
</SCRIPT>
Basically when the user resizes the window the dhtml menu remains in place (specified by x y coordinates). This works fine in IE but when I try in mozilla the problem persists and the menu jumps around if i resize the window.
Has anyone got a fix for this? Or am I better off contacting the author?
The original script can be found here: http://www.youngpup.net/2001/ypslideoutmenus
Last edited by GregD : April 17th, 2004 at 10:34 AM.
|