0.0.8 • Published 8 years ago

scroll-to-target v0.0.8

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

scroll-to-target (scrollToTarget)

Simple, small, reliable and pure javascript scroll library with 0 dependencies.

NPM

Usage

scrollToTarget(selector, speed, offset)
name : string

A valid dom selector

Required

speed : number

Scroll duration in milliseconds

Optional, defaults to: 300 {ms}

offset : number

Space in pixels between the target element and the window top.

Optional, defaults to: 0 {pixels}

Example

scrollToTarget('#valid-dom-element-selector', 500, 80)

The code above will scroll the page to the #valid-dom-element-selector with 80px gutter and a duration of 500ms.

Compatibility

IE8+, iOS Safari 3.2+, MS Edge, Chrome 4+, Firefox 3.5+

LICENSE

MIT

0.0.8

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago