View Full Version : PageX....PageY ??
O_o !
05-19-2002, 07:58 AM
Hello. Can someone plz tell me what the heck is wrond with my code here? Thnx
:banger:
<body>
<script language="JavaScript">
window.captureEvents(Event.MOUSEMOVE);
function handleX(evnt){
document.write("X: " + evnt.pageX);
return true;
}
function handleY(evnt){
document.write("Y: " + evnt.pageY);
return true;
}
window.onMOUSEMOVE = handleX;
window.onMOUSEMOVE = handleY;
</script>
</body>
It seems so easy :confused:
scoutt
05-19-2002, 12:43 PM
evnt???
how about event
O_o !
05-19-2002, 12:53 PM
No, even "event" or "Event" won't work. I actually took part of the code from "Pure JavaScript" (by R. Allen Wyke, Jason D. Gilliam, and Charlton Ting) and then modified it to my needs....even in the book there is "evnt" instead of "event"....anyone?:help:
scoutt
05-19-2002, 01:15 PM
that was only a guess as I don't know javascript that well.
http://www.snippetlibrary.com/viewhtml.php?id=5&kid=24&siteid=73
but I had something at my site that might help.
O_o !
05-19-2002, 02:18 PM
Thanx! Thats a cool site you have! That was what I was looking 4!!
scoutt
05-19-2002, 03:01 PM
thanks, glad you liked it and glad I can help.
Jon Hanlon
05-19-2002, 08:05 PM
function handleX(evnt){
document.write("X: " + evnt.pageX);
return true;
}
evnt???
how about event
No, evnt is correct. Netscape passes the event object automatically to the function, and evnt is a naming handle.
This sample code would only work for Netscape.
(And even then not very well, before you can define event handlers you must enable event capture. And you can't have two event handlers for the one event.)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.