Skip to content

neomasterr/scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm

scroll

Native instant behaviour scroll to DOM element

Install

npm install @neomasterr/scroll

Usage

Example 1

default behaviour

import Scroll from '@neomasterr/scroll';

Scroll.to(document.getElementById('foo'));

Example 2

custom options

import Scroll from '@neomasterr/scroll';

Scroll.to(document.getElementById('foo'), {
    time: 2.0,
    fps: 60,
    offsetY: 500,
    interruptable: false,
});

Example 3

callback (promise)

import Scroll from '@neomasterr/scroll';

Scroll.to(document.getElementById('foo')).then(() => {
    // scroll done
}).catch(() => {
    // scroll interrupted    
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors