The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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.

GJones -> you prompted me to look through mootools once more and sure enough, there was a function. Ugh so much wasted time, but I've learned a valuable lesson.

Mittineague -> Your comment got me started on writing a function that fired on a delay after the mouseOut that then checked the coordinates. I'm confident it would have worked. Not sure how I would have implemented focus() and blur(), but fortunately I won't need to.

Thanks for the advice even when faced with a dumb question. I suppose this happens often enough, I just had to look at it differently.