Miss any of our Open RFC calls?Watch the recordings here! »

scroll-to-bottomjs

1.1.0 • Public • Published

Scroll To Bottom

A small promise aware helper function to scroll a webpage to the bottom. This can be helpful for triggering lazy loading images (or anything using scroll based observation).

Usage

Once the function is included in the browser, you can use scrollToBottom with the defaults, or pass options:

scrollToBottom();
scrollToBottom({ frequency: 50, timing: 5 });

Options

  • options.frequency (default: 100) - How many scroll increments
  • options.timing (default: 8) - The amout of ms to pause between scroll increments
  • options.remoteWindow (default: window) - The browsers window object. Can be handly for test runners like Cypress, which run the subjects test in a remote iframe

Keywords

none

Install

npm i scroll-to-bottomjs

DownloadsWeekly Downloads

2,649

Version

1.1.0

License

MIT

Unpacked Size

254 kB

Total Files

25

Last publish

Collaborators

  • avatar