1.0.5 • Published 8 years ago

scroll-to-js v1.0.5

Weekly downloads
6
License
ISC
Repository
github
Last release
8 years ago

scroll-to-js

NPM package of a pure js scroll to element without the usage of jQuery

It's a simple function using promises to get the same effect as jQuery's animate without the use of the same

Usage

The arguments are (element, target, duration), target it can be a number or the element's offset to top, usually i use this kind of functions to scroll the body

Just require it
let scroller = require('scroll-to-js')
Find an element
let elem = document.querySelector('#element')
Execute it
scroller(document.body, elem.offsetTop, 1000)
TODO
  • Make document body as default
  • Change arguments order
  • Add more validations
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago