@yrobot/auto-scroll
v3.0.1
Published
This is a tool which makes scroll-container auto scroll to the bottom easy.
Downloads
930
Readme
How to use
npm
yarn add @yrobot/auto-scroll
import autoScroll from "@yrobot/auto-scroll";
autoScroll({ selector: "#scroll-container-id" });
script - iife
<script src="https://cdn.jsdelivr.net/npm/@yrobot/auto-scroll/build/index.iife.js"></script>
<script>
autoScroll.default({ selector: "#scroll-container-id" });
</script>
Why
Handle Several Situations
- [✓] The subtree children list length increase
- [✓] The direct child element height increase
Pack Up Useful Utilities Logic
Stop auto scroll when user scroll up
es
import autoScroll, { escapeWhenUpPlugin } from "@yrobot/auto-scroll";
autoScroll({
selector: "#scroll-container-id",
plugins: [escapeWhenUpPlugin()],
});
iife
autoScroll.default({
selector: "#scroll-container-id",
plugins: [autoScroll.escapeWhenUpPlugin()],
});