1.0.5 • Published 7 years ago

scroll-window-to-element v1.0.5

Weekly downloads
43
License
MIT
Repository
github
Last release
7 years ago

scroll-window-to-element

Simple ES6 Class for scroll window to DOM element with smooth animation

Example: komock.github.io/scroll-window-to-element/

Install

npm i --save-dev scroll-window-to-element

Usage

// Absolute path to module 'node_modules/scroll-window-to-element/lib/scroll-window-to-element.js'
import scrollToElement from 'scroll-window-to-element';
let scroller = new scrollToElement({
		anchors: 'nav a'
	});
scroller.init();

Options

OptionTypeDefaultDescription
anchorsstring (html)'ahref*="#"'Selector for anchor (links)
durationnumber350Animation duration
offsetnumber0Scroll offset
easingstring'easeInOut'Animation easing. Available: linear, easeInOut

To link section you can use 'id' or 'data-section' attribute (without '#').

Features

  1. Fast and lightweight
  2. No jQuery
  3. ES6 ready
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago