jd2007 Posted August 6, 2007 Share Posted August 6, 2007 <html> <head> <script type="text/javascript"> var z=0; function show_coords(event) { x=event.clientX y=event.clientY document.write(x); } setInterval("show_coords(event)",50) </script> </head> <body onmousemove="show_coords(event)";> <script></script> <p>Click in the document. An alert box will alert the x and y coordinates of the mouse pointer.</p> <script> </script> </body> </html> now, x doesn't change automatically...i want x to change automatically everytime the mouse moves...what to do...pls help Link to comment https://forums.phpfreaks.com/topic/63497-how-to-make-x-change-automatically-everytime-the-mouse-moves-pls-see-below/ Share on other sites More sharing options...
jd2007 Posted August 6, 2007 Author Share Posted August 6, 2007 never mind, i did it. i added back() in the show_coords(event) function.... <html> <head> <script type="text/javascript"> var z=0; function show_coords(event) { x=event.clientX y=event.clientY document.write(x); back() } setInterval("show_coords(event)",50) </script> </head> <body onmousemove="show_coords(event)";> <script></script> <p>Click in the document. An alert box will alert the x and y coordinates of the mouse pointer.</p> <script> </script> </body> </html> Link to comment https://forums.phpfreaks.com/topic/63497-how-to-make-x-change-automatically-everytime-the-mouse-moves-pls-see-below/#findComment-316502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.