本文介绍了背景选项卡动画和jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

查看code:

问题:在其中实现requestAnimationFrame浏览器,当动画选项卡设置为背景(新标签页打开),动画计时是borked

Problem: In browsers which implement requestAnimationFrame, when tab with animation is set to background (new tab opened), animation timing is borked.

:我requestAnimationFrame的理解是,当移动到后台标签页的动画应该停止,但是从这个例子,它看起来像WebKit浏览器完成当前的动画,然后停止

Question: My understanding of requestAnimationFrame is that animation should stop when moved to a background tab, but from this example, it seems like webkit browsers complete the current animation and THEN stop.

问题的似乎的来自一个事实,即在第二和第三球需要移动之前的延迟,需要的setTimeout。是否有使用requestAnimationFrame在jQuery的实现,还是我只是编码这个错误?的方式有问题。

The problem seems to come from the fact that the second and third balls need a delay before moving, requiring a setTimeout. Is there a problem with the way requestAnimationFrame is implemented in jQuery, or am I just coding this wrong?

我试着遵循 http://api.jquery.com/animate/使用延迟()和队列(),但似乎无法得到正确的效果。

I've tried to follow the advice on http://api.jquery.com/animate/ using delay() and queue(), but can't seem to get the right effect.

推荐答案

使用旧版本的jQuery requestAnimationFrame(1.4.2)之前。似乎是错误的。我不认为英国皇家空军的正确实施呢。

Using an old version of jQuery before requestAnimationFrame (1.4.2). Seems wrong. I don't think rAF is properly implemented yet.

这篇关于背景选项卡动画和jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 20:49