I posted a little bit ago about a problem I was having with a rollover menu
effect. I think I know a way to fix the problem but I have been having trouble
getting it to work because I very basically no Javascript. :D I need a way to
calculate the position of an object on my page and then based off that object,
I could use a variable which could be calculated on mousemove to find out where
the object is and then set the variable for the event I need it for. Here is my
scripting so far, it is not working because it now displays the menu all the
time instead of using the variable to find out the onclose function variable.
So now the menu never closes after it has been rolledover. If there is a better
way to do this, please let me know! :D <script type='text/javascript'> <!--
var time = 3000; var numofitems = 6; var menuYmin; var menuYmax; //menu
constructor function menu(allitems,thisitem,startstate){ callname=
'gl'+thisitem; divname='subglobal'+thisitem; this.numberofmenuitems =
numofitems; this.caller = document.getElementById(callname); this.thediv =
document.getElementById(divname); this.thediv.style.visibility = startstate;
} //menu methods function ehandler(event,theobj){ for (var i=1; i<=
theobj.numberofmenuitems; i++){ var shutdiv =eval( 'menuitem'+i+'.thediv');
shutdiv.style.visibility='hidden'; }
theobj.thediv.style.visibility='visible'; } THIS NEXT FUNCITON I ADDED
function globalnavposition(thisitem) { globalnav = 'globalNav' +thisitem;
menuYmin = getpageOffsetTop(globalnav); menuYmax = menuYmin + 64; }
function closesubnav(event){ if ((event.clientY < menuYmin)||(event.clientY >
menuYmax)){ for (var i=1; i<= numofitems; i++){ var shutdiv
=eval('menuitem'+i+'.thediv'); shutdiv.style.visibility='hidden'; }
} } // --> </script> </head> <body
onmousemove='globalnavposition(thisitem);' 'closesubnav(event);'> I know
almost no JavaScript, the code for finding the variable I found from a website
and tried to modify it for what I needed. I don't think it is even working
properly. Thanks so much! You all have been very helpful so far.