NPM You can also use NPM (or your favorite package manager). npm install smooth-scroll 2. Add the markup to your HTML. No special markup needed—just standard anchor links. Give the anchor location an ID just like you normally would. ...
react-smooth-scroll-hook [](https://github.com/ron0115/react-smooth-scroll-hook/blob/master/LICENSE) [;varexampleBtn =document.querySelector('.example-button');varexampleDestination =document.querySelector('.example-destination');// This function can easily be an onCli...
# npmnpm install smoothscroll-polyfill --save# yarnyarn add smoothscroll-polyfill When including the polyfill in a script tag, it will run immediately after loaded. If you are importing it as a dependency, make sure to call thepolyfillmethod: ...
# npm npm install smoothscroll-polyfill --save # yarn yarn add smoothscroll-polyfill When including the polyfill in a script tag, it will run immediately after loaded. If you are importing it as a dependency, make sure to call the polyfill method: import smoothscroll from 'smoothscroll-polyf...
Alternatively, you can install smoothscroll as a dependency using npm: npm install --save smoothscroll Example usage as a module, binding to a custom element: var smoothScroll = require('smoothscroll'); var exampleBtn = document.querySelector('.example-button'); var exampleDestination = docu...
想要兼容性好那必须是 js 啦,该库是在浏览网站时发现的一段 js,但是在 npm 上未发现,所以分享下。 该库一旦引入所有元素滚动皆为惯性滚动 demo start smoothstop smooth 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21