I've written a DHTML menu system for my web site, but before I put it on the site I want to get one thing working: the menu positions. I need a way, in JavaScript, to get the X,Y coordinates of the mouse and then use those to set the position of the menu (like "left:getX(); top:getY();"😉 or something, so that the position of the meu is based on where the user's mouse is.
I've tried messing around with 'document.captureEvents(Event.MOUSEMOVE)' and writing a function to return the X and Y position, but it doesn't seem to work? Anyone else know what to do, or could clarify for me how to get the mouse coordinates? Thanks for any info.
I've tried messing around with 'document.captureEvents(Event.MOUSEMOVE)' and writing a function to return the X and Y position, but it doesn't seem to work? Anyone else know what to do, or could clarify for me how to get the mouse coordinates? Thanks for any info.