mouse tracking on IE

Posted by Gotys on Stack Overflow See other posts from Stack Overflow or by Gotys
Published on 2010-03-19T12:17:45Z Indexed on 2010/03/19 12:21 UTC
Read the original article Hit count: 212

Filed under:
|

Consider the following snippet:

$(document).bind('mousemove', function(e)
                 {
                    $('#someDiv').css({left: e.pageX+'px', top: e.pageY+'px'});
                 });

This should make #someDiv follow the mouse (tooltip), when the css value for "position" is set to absolute.

Works as expected, except when you Zoom IN or OUT in IE7 ( dind't try other version of IE). Then the e.pageX gets completely off. The more you zoom in (using your mousewheel + CTRL), the more off the positioning gets.

I've tried to break jQuery's UI demos (sliders) and it seems not even jQuery guys have this figured out. Is there any genius out there who knows how to fix this nasty thing?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about mouseevent