Spectacular Free Slide Show
MP3 Sound Streamer
Email Link Encoder
Stream Website Audio
Cool Free Text Scroller
CodeLifter.com
S
oftware & S
cripts by CodeBrain.com
Home
JavaScripts
PopUp Maker
-
po
pup wind
ows
CodeLifter 5
-
source viewer
ScrollBar Styler
-
color scrol
lbars
Flash Fixer
-
rem
ove al
erts
Roll-Over Maker
-
image roll-overs
Link Cloaker 5
-
enc
rypt links
Site Capture 3
-
hidden frames
CHMOD 2 Utility
-
chmod utility
BlackBird 3.0
-
browser shell
Zoom 1.0
-
magnifier
MicroTicker.com
-
text scroller
CodeBrain.com
-
j
ava app
lets
D3Q.com
-
xp icon control
BrainCode.com
-
j
ava app
lets
MailToProtector
-
protect email
Java Applets
Perl Scripts
Affiliate Program
Index
JavaScript Capture Mouse X-Y Position Script
Quick-Take Mini-Tutorial
Index
Current
Mouse
Position
X
Y
Click
here
to select the code in the window below.
Use Ctrl+C to copy it to your clipboard.
<html> <body> <form name="Show"> <input type="text" name="MouseX" value="0" size="4"> X<br> <input type="text" name="MouseY" value="0" size="4"> Y<br> </form> <script language="JavaScript1.2"> <!-- // Detect if the browser is IE or not. // If it is not IE, we assume that the browser is NS. var IE = document.all?true:false // If NS -- that is, !IE -- then set up for mouse capture if (!IE) document.captureEvents(Event.MOUSEMOVE) // Set-up to use getMouseXY function onMouseMove document.onmousemove = getMouseXY; // Temporary variables to hold mouse x-y pos.s var tempX = 0 var tempY = 0 // Main function to retrieve mouse x-y pos.s function getMouseXY(e) { if (IE) { // grab the x-y pos.s if browser is IE tempX = event.clientX + document.body.scrollLeft tempY = event.clientY + document.body.scrollTop } else { // grab the x-y pos.s if browser is NS tempX = e.pageX tempY = e.pageY } // catch possible negative values in NS4 if (tempX < 0){tempX = 0} if (tempY < 0){tempY = 0} // show the position values in the form named Show // in the text fields named MouseX and MouseY document.Show.MouseX.value = tempX document.Show.MouseY.value = tempY return true } //--> </script> </body> </html>
Get The Code!
CodeLifter is a
CodeBrain.com
Sister Site
© 1995-2008 OEC Corp & CodeLifter.com
CodeLifter™ & CodeBrain™
Legal Notices
CodeBrain InterNET Group
BrainCode.com
CodeFoot.com
CodeBelly.com
D3Q.com
etLux.com
FFFast.com
IEFix.com
PopUpWorks.com
MicroTicker.com
DavidSosnowski.com
OECCorp.com
MailToProtector.com
CodeBrain.com
Free MP3
Downloads
Contemporary classical music, completely free.
.