Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只是想了解为什么地狱window.requestAnimationFrame接受第二个参数作为元素,这背后的原因是什么?
window.requestAnimationFrame
我很想知道这个函数的底层执行......
添加它是为了当元素不在视图中时(例如由于滚动),动画不会运行。
从规格:
编辑说明 ISSUE-4 我们是否希望允许将元素传递给 requestAnimationFrame,以便在滚动出视图时限制或暂停影响给定元素的动画?
编辑说明
ISSUE-4 我们是否希望允许将元素传递给 requestAnimationFrame,以便在滚动出视图时限制或暂停影响给定元素的动画?
可以在此处找到有关此问题的更多信息。