为了在现代浏览器厂商还没完全跟进到位的时候抢先用上 WAAPI(Web Animation API简称),我们可以选择引入针对 Web Animation API 的 Polyfill 库 [https://github.com/web-animations 因此我们只需要文件里引入以下js,就可以完美体验: <script src="https://cdn.jsdelivr.net/<em>web-animations</em>/latest/web-animations.min.js
---- 总结 动画应该最大复用化,不然太多动画,虽然效果挺炫的,那打包体积相对也大很多 对于不支持web-animationsAPI的浏览器,应当引入对应的polyfill来兼容【web-animations
为了在现代浏览器厂商还没完全跟进到位的时候抢先用上 WAAPI(Web Animation API简称),我们可以选择引入针对 Web Animation API 的 Polyfill 库 [https://github.com/web-animations 因此我们只需要文件里引入以下js,就可以完美体验: <script src="https://cdn.jsdelivr.net/<em>web-animations</em>/latest/web-animations.min.js
同时 W3C 官方也为开发者提供了 web-animations/web-animations-jspolyfill。
script = document.createElement('script'); script.src = 'https://cdnjs.cloudflare.com/ajax/libs/web-animations
web.dev/device-pixel-content-box/ [176] Web Animations API improvements in Chromium 84: https://web.dev/web-animations