🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

scroll-window-to-element

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-window-to-element

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

1.0.5
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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)'a[href*="#"]'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

  • Fast and lightweight
  • No jQuery
  • ES6 ready

FAQs

Package last updated on 20 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts