@yrobot/auto-scroll
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @yrobot/auto-scroll

Weekly Downloads

70

Version

3.0.1

License

ISC

Unpacked Size

9.62 kB

Total Files

6

Last publish

Collaborators

  • yrobot