预渲染动画 jQuery

发布于 2024-10-11 11:49:53 字数 102 浏览 0 评论 0原文

只是想知道是否有人知道如何在 jQuery 中预渲染动画。基本上,我第一次运行动画时它很不稳定......但从那以后当我运行它时,它运行得非常流畅......

有什么想法吗?

Just wondering if anyone has any idea how I can Prerender Animations in jQuery. Basically the first time I run an animation it is jerky... but from then on when I run it, it runs perfectly smooth...

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一百个冬季 2024-10-18 11:49:53

(据我所知)没有办法做你所要求的事情。

JavaScript 动画是通过从一个 CSS 值转换到另一个 CSS 值(如边距、顶部、宽度、高度等)来完成的。我真的不明白你如何“预渲染”这个。我唯一能想到的是预先定义将在 CSS 中应用的值序列(如果您使用复杂的指数或三角函数缓动)。即便如此,这也不是您(必然)使用 jQuery 要做的事情。

你有一个让你的动画突​​然变得更流畅的例子吗?

There's no way (that I know of) to do what you're asking.

Javascript animations are done by transitioning from one CSS value to another (like margin, top, width, height, etc). I don't really see how you could "pre-render" this. The only thing I can think of is pre-defining the sequence of values which will be applied in CSS (if you're using complicated exponential or trigonometric functions easing). Even then, it's not something you would do (necessarily) with jQuery.

Do you have an example of your jerky animation that suddenly runs smoother?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文