|
|
|
|
#1 |
|
Member
Join Date: Aug 2005
Posts: 28
|
I wrote a little script to detect mouse position--a stripped-down version is pasted below, just to show the basic coding. This works fine in IE and Firefox. As the mouse moves within the window, its X/Y coordinates are displayed in the form. HOWEVER (there's always a "however"
), if I add any "<!DOCTYPE ..." statement at the top, then in IE it only works if the mouse stays within the red-outlined form boundary. Is this just another IE bug, or is there something I can add to make IE happy? Or is there some alternative script that will do the same thing?Thanks, John <html> <head> <script type="text/javascript"> function mouseCoords(event){ document.showXY.xPos.value=event.clientX; document.showXY.yPos.value=event.clientY; } </script> <style type="text/css"> form {border:1px solid red;} </style> </head> <body onmousemove="mouseCoords(event)"> <form name="showXY"> <input name ="xPos" type="text" /><br /> <input name ="yPos" type="text" /> </form> </body> </html> |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DW8 mouse-over errors | zofiaphoto | Web Design | 9 | 08-18-2006 09:06 AM |
| Web rank position software | ktinkel | Web Site Building & Maintenance | 0 | 05-11-2006 07:55 AM |
| Laptop mouse | Richard Waller | The Corner Pub | 1 | 05-08-2006 04:29 AM |
| Squashed mouse! | Kelvyn | The Corner Pub | 1 | 01-09-2006 11:13 AM |
| New mouse! | iamback | General Publishing Topics | 5 | 12-20-2005 01:30 PM |