Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

window-scroller

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

window-scroller

window scrolling animating

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

window-scroller

Credit:

@shunryu111 http://stackoverflow.com/users/2630316/shunryu111

Based on:

http://stackoverflow.com/a/26798337/5068410

install

npm install window-scroller --save

usage

import Scroller from 'window-scroller';
// OR
const Scroller = require('window-scroller');

// Position
Scroller.to(500).scroll()
Scroller.to(500).speed(700).scroll()
Scroller.to(500).easing('easeOutSine').scroll();
Scroller.to(500).speed(700).easing('easeInOutSine').scroll();

// Element in the DOM
const element = document.getElementById('rolling');
Scroller.to(element).scroll()
Scroller.to(element).speed(700).scroll()
Scroller.to(element).easing('easeInOutQuint').scroll();
Scroller.to(element).speed(700).easing('easeInOutQuint').scroll();

// Save the scroller and use whenever you need
const rollingScroller = Scroller.to(element).speed(700).easing('easeInOutQuint');
rollingScroller.scroll()

const topScroller = Scroller.to(0).speed(700).easing('easeOutSine');
topScroller.scroll()

options

speed (Integer):

  • 0 -> inf

easing (String):

  • easeOutSine
  • easeInOutSine
  • easeInOutQuint

to (Integer | Element):

  • DOM Element
  • Integer

Keywords

FAQs

Package last updated on 10 Mar 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc