The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
Mouse Position Demo
Posted by: TheBMan | December 18, 2010 @ 10:03am
HTML Code
[
Download
]
<html> <head> <script language="javascript"> function doSomething(e) { var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } document.getElementById('x').innerHTML=posx; document.getElementById('y').innerHTML=posy; } </script> </head> <body> x: <span id="x"></span>,y:<span id="y"></span> <div style="width:100%;background:red;height:100%" onmousemove="doSomething()"> </div> </body> </html>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.50 / 8
60 Votes
http://codebin.yi.org/1016
page generated in 0.00 seconds