jQuery animate() and browser performance

后端 未结 7 720
小蘑菇
小蘑菇 2020-12-03 09:48

I\'ve got some elements that I\'m moving across the page very slowly. Essentially, I\'m decreasing the left margin of two images over a span of 40 seconds or so.

Vi

7条回答
  •  悲&欢浪女
    2020-12-03 10:28

    I know this is an oldish question and Tim provided a great answer, but I just thought I should post an update for anyone looking for a solution to this problem, since there's now a simpler way...

    As of jQuery 1.4.3 you can set the interval jQuery's animate uses directly via the jQuery.fx.interval property. So you can simply do something like:

    jQuery.fx.interval = 50;
    

提交回复
热议问题