Getting the mouse co-ordinates in JavaScript (all browsers)
We are going to create two functions mouseX(event), mouseY(event). In each function we do the following Get the event triggered Find the X or Y co-ordinate of that event function mouseX(evt) { evt = (evt) ? evt : ((event) ? event : null); if (evt.pageX) return evt.pageX; if (evt.clientX) return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft […]
Posted at 11:52 am on May 22, 2010 | Leave a comment | Filed Under: javascript | Tagged: all browsers, co-ordinates, event, firefox, IE, javascript, mouse, netscape, opera | Continue reading