By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

onmousemove event fires without mouse movement

P: n/a
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

Oct 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

Ravi wrote:
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(); }

--
S.C.

Oct 17 '05 #2

P: n/a
The other function you suggested also does the same. The status bar
gets updated with the time.
--
Ravi

Oct 18 '05 #3

P: n/a
Ravi <ra********@gmail.com> wrote in message news:11**********************@o13g2000cwo.googlegr oups.com...
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?

--
S.C.
Oct 18 '05 #4

P: n/a
<!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

Oct 18 '05 #5

P: n/a
Ravi <ra********@gmail.com> wrote in message news:11**********************@g14g2000cwa.googlegr oups.com...
<SNIP>
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.

--
S.C.

Oct 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.