/scrollview-resize

Report changes to the dimensions of an Element's scrollWidth and scrollHeight

Primary LanguageTypeScriptMIT LicenseMIT

Scrollview Resize

Report changes to the dimensions of an Element's scrollWidth and scrollHeight

Why does this project exist?

Scrollview Resize provide the solution that we can report changes to the dimensions of an Element's scrollWidth and scrollHeight.

Installation

npm install scrollview-resize

// or yarn
yarn add scrollview-resize

Polyfill

ResizeObserver is used in the code, IE dont support it, so you need polyfill for that.

Examples

import { SVResizeObserver } from 'scrollview-resize';

const el = document.querySelector('selector');

const observer = new SVResizeObserver(() => {
  console.log('Scroll size changed');
});

observer.observe(el);

License

MIT