Socket
Socket
Sign inDemoInstall

scroll

Package Overview
Dependencies
3
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scroll

A function that animates an element’s scrollTop/scrollLeft values.


Version published
Maintainers
1
Install size
23.6 kB
Created

Readme

Source

scroll

A function that animates an element’s scrollTop/scrollLeft values.

Browser support

Install

npm install scroll

API

  scroll.top || scroll.left (
    element (element),
    target (number): the desired scrollTop position,
    [options (object): { duration, ease },]
    [callback (function): fn(error, position)]
  ) 

Note: The easing functions are those specified in component/ease.

Example

var scroll = require('scroll')

var element = document.body

scroll.top(element, 200, { duration: 1000 }, function(error, position) {})
scroll.left(element, -200, { ease: 'inBounce' })

License

MIT

Keywords

FAQs

Last updated on 06 Jan 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc