开发者

jQuery mousemove animation

I'm using the mousemove event handler with jQuery:

$(document).mousemove(function(e) { updateDownloadPosition(e); } );

It works perfectly in Chrome but every other browser I've tried the mousemove event isn't fired until the mouse stops moving, instead of constantly every time it moves.

--EDIT--

Ok so as Tim Down rightly pointed out, its not the mousemove event, its my function, so now my focus is on my animation function:

paralaxArray[i].object.animate(
            {marginLeft: newX},
            {duration: 3000,
            easing: 'easeOutExpo'});

In order to get this to reset properly on mousemove I was using the stop() function:

paralaxArray[i].object.stop().animate(

...b开发者_运维技巧ut this produces choppy animation in chrome so now I'm using clearQueue:

paralaxArray[i].object.clearQueue();
paralaxArray[i].object.animate(
            {marginLeft: newX},
            {duration: 3000,
            easing: 'easeOutExpo'});

But doing it this way (and with stop() ) causes all browsers other than chrome to only animate once the mouse has stopped moving. What could be causing this?? Am I going to have to write my own animation update function?

Thanks again :)

Thanks


Just to finish off this question, I did end up writing my own animation function in the end which then worked perfectly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜