0

I am having a Grid in my page and want to do some operation when the mouse moves on the header of the grid in client side

this is my script

$("th").mousemove(function(event){ alert("moved");})

In IE11 the if i place the mouse pointer on the header the alert message is thrown untill the focus is lost but in Chrome the alert message is thrown only when the mouse is moved over the header

Gowthaman
  • 790
  • 1
  • 10
  • 29
  • I have tested the behaviour of that snippet on Chromium and IE11. It appears to work as expected. You are aware that JS execution stops when there is an alert, right? – apscience Jan 02 '15 at 10:48
  • yes it should stop its working in Chrome. but in IE11 it shows the alert message consecutively until it lost the focus. I am using infragistics grid. – Gowthaman Jan 02 '15 at 10:51
  • with this snippet ( http://jsfiddle.net/5vq0z5L8/ ) I've exactly the opposite behavior, IE11 fires the event one time,chrome instead fires the event repeatedly while the cursor still hover the tag (even if mouse doesn't move) – Luca Jan 02 '15 at 10:57
  • once i click ok on the alert message box it disappears in chrome but in ie it shows again and again even after click of ok button(with space button not with mouse click) – Gowthaman Jan 02 '15 at 10:59
  • luca ie fires repeatedly but chrome fires only once while it is hover – Gowthaman Jan 02 '15 at 11:01
  • here it's the opposite, I'm using Chrome Version 39.0.2171.95 m and IE 11.0.9600.17498 any other scripts on the same object ? – Luca Jan 02 '15 at 11:03
  • and with Firefox 34.0 works like in IE11, event is fired one time (IMHO the correct behavior) – Luca Jan 02 '15 at 11:05
  • the chrome version is 39.0.2171.95 yes i need to include some more functionality only for the testing purpose i have given the alert message – Gowthaman Jan 02 '15 at 11:08

1 Answers1

0

It's really a strange situation, because the correct behavior of mousemove event is to get fired one time if the mouse move and if you close the alert with keyboard (both Enter or white space) without moving the cursor.

$(document).ready(function() {
    $("th").mousemove(function(event){ alert("moved");})
});

With this code I've the right behavior on IE 11.0.9600.17498 and Firefox 34.0 and a "bad" behavior with Chrome Version 39.0.2171.95 m, but it's appear to be a known bug already discussed here

This is the open issue at Chromium that confirm this "theory"

Community
  • 1
  • 1
Luca
  • 1,588
  • 2
  • 22
  • 26
  • Ie Version i am using is IE 11.0.9600.17501IS – Gowthaman Jan 02 '15 at 11:31
  • seems to be a language specific version, and seems to have some issues http://answers.microsoft.com/zh-hans/ie/forum/ie11-windows_7/ie%E7%89%88%E6%9C%AC-110960017501-%E5%92%8C/2a2ee971-daed-468f-8f07-47b0080b0057 p.s: I read it with google transaltion because I don't know ideograms ;-) – Luca Jan 02 '15 at 11:44