
简单和轻量级(3kb缩小和压缩)javascript插件创建平滑和美丽的动画跟着时滚动展示!利用最直观的互动能力,让你的网站变得活跃起来!支持Vue、React。
NPM Setup npm install lax.js import lax from 'lax.js' Basic Browser Setup Add lax.js to your html <script src="lib/lax.min.js" > <!-- or via CDN --> <script src="https://cdn.jsdelivr.net/npm/lax.js" > Initialize the plugin window.onload = function() { lax.setup() // init const updateLax = () => { lax.update(window.scrollY) window.requestAnimationFrame(updateLax) } window.requestAnimationFrame(updateLax) } Add class and attributes to the HTML tags you want to animate e.g. <p class="lax" data-lax-preset="spin fadeInOut">Look at me goooooo!</p> Scroll and enjoy!