Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Re: how do I do event.clientX in Netscape?
- From: javascript@xxxxxxxxxx (Lewis Shadoff)
- Subject: [Javascript] Re: how do I do event.clientX in Netscape?
- Date: Wed, 27 Mar 2002 12:27:03 -0600
At 09:46 AM 3/27/02, Lau wrote:
>How do I detect the current cursor position in NN4.7 and in NN6?
>
>In IE I use the following:
>
>var x=event.clientX;
>var y=event.clientY;
>
>but it doesn't work in Netscape :-(
Here is a simple script which displays the cursor position in the status
bar in NN4.7 (doesn't work in NN6 or IE):
<!--
function mouseProc() {
window.captureEvents(Event.MOUSEMOVE);
window.onmousemove = showPos;
}
function showPos(e) {
if (e.which == 1) {
var xPos = e.pageX;
var yPos = e.pageY;
window.status = "x = " + xPos + " y = " + yPos;
}
}
//-->
Call it up in the body tag:
body onLoad=mouseProc()
Lew
Lewis A. Shadoff, Ph.D.
Brazosport College
Lake Jackson, TX
- Prev by Date: [Javascript] Change the Cursor/Mouse Location
- Next by Date: [Javascript] Change the Cursor/Mouse Location
- Previous by thread: [Javascript] Change the Cursor/Mouse Location
- Next by thread: [Javascript] question: get email stored in outlook express from the web
- Index(es):