Stickybomb Posted February 20, 2007 Share Posted February 20, 2007 lets say that when i put my mouse over an imagemap that a layer becomes visible at or in relation to the mouses position. how do you get the mouses position? Link to comment https://forums.phpfreaks.com/topic/39340-solved-detecting-mouse-position/ Share on other sites More sharing options...
weknowtheworld Posted February 20, 2007 Share Posted February 20, 2007 Try this : <html> <head> <script language="JavaScript"><!-- if (document.layers) document.captureEvents(Event.MOUSEMOVE); document.onmousemove=mtrack; function mtrack(e) { var Text= 'Coordinates: '; if (document.layers) Text += e.pageX+','+e.pageY else Text += event.x+','+event.y; window.status= Text; } //--></script> </head> <body> Move the mouse and see the status change </body> </html> Link to comment https://forums.phpfreaks.com/topic/39340-solved-detecting-mouse-position/#findComment-189727 Share on other sites More sharing options...
Stickybomb Posted February 20, 2007 Author Share Posted February 20, 2007 nice;) thxs this will sure help Link to comment https://forums.phpfreaks.com/topic/39340-solved-detecting-mouse-position/#findComment-189790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.