Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

webdeveric/scroll-to

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scroll To

Scroll to an element.

Example Usage

import { scrollTo } from 'scroll-to';

scrollTo(
  '#some-element',
  {
    offset: 0,
    duration: 1000,
    complete: function() {
      // Do something after scrolling
    }
  }
);
<a href="#some-element"
  data-scroll-to="#some-element"
  data-scroll-duration="1000"
  data-scroll-offset="0"
>Click Me</a>