I've been trying to solve this problem and after extensive searching i'm not sure if it's possible. It also might be a very simple fix that I haven't found yet.

Building a menu w/ mootools, the development page can be seen here: http://www.heliopower.com/dev/

The menu slides up when user mouses over, but I was having a ton of problems with it sliding back down when user mouses off. Correct me if I'm wrong, but the mouseOut function is very finicky. I experimented with a function I found online to make sure mouseOut was detecting the mouse moving out of the right div (in a layered setup) but it didn't work well, and didn't work at all in IE6. I've included the function below this text--

Thus, I decided the best way to deal with this was to have the script check to see if the cursor is not over the menu, and if it's not, to lower the menu. I set an interval to fire a function every second that will (theoretically) check the mouse coordinates, then check to see if it is currently hovering above the menu. My problem is that i'm not sure if it's possible to find the mouse coordinates without clicking. I've found a ton of functions that will detect the coordinates of an event, but this isn't optimal. I don't want the function to fire on mouseMove, b/c that will slow everything down. An example of one of these functions is here:


Does anyone have any advice? Is there a way to detect the cursor location in JS w/out using an event?

Here is the aforementioned mouseOut code, which I got from http://www.quirksmode.org/js/events_mouse.html. The author has a description of the function there, it essentially checks and rechecks that the mouse is moving out of the correct layer and terminates the function if it is not.


function menuOut(e) {

if (!e) var e = window.event;
var tg = (window.event) ? e.srcElement : e.target;
if (tg.nodeName != 'DIV') return;
var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
while (reltg != tg && reltg.nodeName != 'BODY')
reltg= reltg.parentNode
if (reltg== tg) return;

//If it gets this far, the mouse has moved out of the correct object


Thanks in advance-