JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 38499
  • Score
    100M100P100Q140358F
  • License MIT

Smooth scrolling to an element via selector or node reference

Package Exports

  • scroll-to-element

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scroll-to-element) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

scroll-to-element

Smooth scrolls to element of the specified selector or element reference with optional offset, easing, and duration via scroll-to

NPM

EXAMPLE

scrollToElement(selector, <options>)

var scrollToElement = require('scroll-to-element');

scrollToElement('#id');

// with options
scrollToElement('.className', {
    offset: 0,
    ease: 'out-bounce',
    duration: 1500
});

// or if you already have a reference to the element
var elem = document.querySelector('.className');
scrollToElement(elem, {
    offset: 0,
    ease: 'out-bounce',
    duration: 1500
});

LICENSE

MIT