开发者

what is the difference between normal js timers and this jquery timers plugin?

开发者 https://www.devze.com 2023-03-18 16:09 出处:网络
If I use setInterval or setTimeout for an ani开发者_如何学Pythonmation, the speed of the animation is different in all the browsers, but if I use the jquery timer plugin its the speed is almost exactl

If I use setInterval or setTimeout for an ani开发者_如何学Pythonmation, the speed of the animation is different in all the browsers, but if I use the jquery timer plugin its the speed is almost exactly the same in every browser. How exactly does it do that? ive looked through the code of the plugin but i cant figure it out. Here is the link for the plugin jquery.timers


Not likely.

This is at the heart of the plugin

if (!element.$timers[label][fn.$timerID]) 
  element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);
.
.
.
window.clearInterval(timers[label][fn.$timerID]);
0

精彩评论

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