onScrollEnd

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.on

This function simply listen for scroll on the passed element and call the passed callback when reaching the end of it.

Params

  1. $elm*-HTMLElement

    The element to listen on

  2. callback*-Function

    The function to call when scroll end is detected

  3. settings{}TOnScrollEndSettings

    Some settings like offset, etc…

Example

import { onScrollEnd } from '@blackbyte/sugar/dom';
onScrollEnd($elm, () => {
  // do something
}, {
  offset: 50
});

Settings

  1. offset20Number

    An offset to detect earlier the end of the scroll

  2. oncefalseboolean

    true if you want to detect the scroll end just once

  3. times-1number

    Specify a number of times to detect the scroll end

Todo

  • testsnormal