onmousemove event fires without mouse movement

R

Ravi

In IE (tested IE6 on W2k&WXP) onmousemove event appears to fire
continually
when mouse is over the document and not moving or touched at all, even
when
mouse is physically detached from the computer. Same page on Firefox
works
well (event fires only when mouse moves, not when it is static on the
document). Seems a bug, doesn't it? Anyone knows something about this
or a
solution?


Used code:
<script: JavaScript>
document.onmousemove=doit


function doit()
{alert()}
</script>


gives continuous alerts as long as mouse is over document
 
S

Stephen Chalmers

Ravi said:
In IE (tested IE6 on W2k&WXP) onmousemove event appears to fire
continually
when mouse is over the document and not moving or touched at all, even
when
mouse is physically detached from the computer. Same page on Firefox
works
well (event fires only when mouse moves, not when it is static on the
document). Seems a bug, doesn't it? Anyone knows something about this
or a
solution?


Used code:
<script: JavaScript>
document.onmousemove=doit


function doit()
{alert()}
</script>


gives continuous alerts as long as mouse is over document

I would guess that the clearing of the alert box is triggering a mouse
move event.

Try:

function doit(){ window.status=new Date().getTime(); }
 
R

Ravi

The other function you suggested also does the same. The status bar
gets updated with the time.
 
S

Stephen Chalmers

Ravi said:
The other function you suggested also does the same. The status bar
gets updated with the time.
<script: JavaScript>

I'm surprised that worked at all:

<script type='text/javascript'>

Can you show the entire code?
 
R

Ravi

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Example for the onmouseover Event</TITLE>
<SCRIPT>
var counter = 0;
function fnTrackMouse(){
counter++;
window.status="Coords: (" + event.clientX + ", " + event.clientY + ")
" + counter;
}
</SCRIPT>

<!-- SAMPLE_STYLE_END -->
</HEAD>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
LINK="#000000" VLINK="#808080" ALINK="#000000"
onmousemove="fnTrackMouse()">
<BLOCKQUOTE CLASS="body">

<H1>onmousemove Sample</H1>
<P>This sample demonstrates the use of the <b>onmousemove</b> event to
monitor the location of the mouse cursor in a specified region of the
page.
When the mouse is moved over the gray <b>DIV</b>, the yellow
<b>SPAN</b> is updated with the mouse location values obtained from the
<b>clientX</b> and <b>clientY</b> properties on the <b>event</b>
object.</P>

</BLOCKQUOTE>
</BODY>
</HTML>

I have the tried the same example at my office and my home. It behaves
as expected at home(winxphome ie sp2). at office(winXP professional ie
sp2) the counter in the status bar gets incremented with out the
mousemove.

Thanks,
Ravi
 
S

Stephen Chalmers

Ravi said:
I have the tried the same example at my office and my home. It behaves
as expected at home(winxphome ie sp2). at office(winXP professional ie
sp2) the counter in the status bar gets incremented with out the
mousemove.
I can only conclude that your office computer is running some other process
(known to you or otherwise) that is interfering with the browsers mouse handling.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top