Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 1.81 KB

README.md

File metadata and controls

83 lines (63 loc) · 1.81 KB

auto-scroll logo


This is a tool which makes scroll-container auto scroll to the bottom easy.

npm package


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()],
});