Smooth Scroll behavior polyfill
npm install seamless-scroll-polyfill
This repo is forked from iamdustan/smoothscroll and rewritten with TypeScript.
``shnpm
npm install seamless-scroll-polyfill --save
Use polyfill to patch all methods
`js
import { polyfill } from "seamless-scroll-polyfill";polyfill();
`Use specific polyfill
`js
import { elementScrollIntoViewPolyfill } from "seamless-scroll-polyfill";elementScrollIntoViewPolyfill();
`Use methods directly without patching
`js
import { scrollIntoView } from "seamless-scroll-polyfill";scrollIntoView(document.querySelector("#target"), { behavior: "smooth", block: "center", inline: "center" });
`Import via script
`html
``Detailed changes for each release are documented in CHANGELOG.md.