是否可以强制 jquery 使用 CSS3 过渡来实现淡入淡出效果?
这是一个仅限移动设备的网站,因此我希望尽可能地发挥其性能。
最佳答案
第一Google result是jQuery animate enhanced plugin .
Extend $.animate() to detect CSS transitions for Webkit, Mozilla and Opera and convert animations automatically. Compatible with IE6+
Properties supported: (more to come)
- left/right : using translate(x, y) or translate3d(x, y, z)
- top/bottom : using translate(x, y) or translate3d(x, y, z)
- opacity
- width
- height
根据this page ,您应该将插件的 useTranslate3d
选项设置为 true
,以便在 iDevice 上实现更流畅(硬件加速)的动画。
关于jquery - 强制 jquery 使用 css3 来实现其效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9487604/