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

animated-scrollto

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

animated-scrollto

Animated scrolling without any dependency on libraries

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
238
decreased by-17.36%
Maintainers
1
Weekly downloads
 
Created
Source

Animated scrollTo

This is a simple function for animating scroll.

  • No dependency on extra libraries.
  • If user scrolls while animation is running, scroll animation would be immediately canceled.
  • Use as a single script or through bower.

Example usage

button.addEventListener('click', function () {
    animatedScrollTo(
        document.body, // element to scroll with (most of times you want to scroll with whole <body>)
        0, // target scrollY (0 means top of the page)
        10000, // duration in ms
        function() { // callback function that runs after the animation (optional)
          console.log('done!')
        }
    );
});

This will scroll to top of the page and the animation will run for 10 seconds (10000ms).

Available on Bower

bower install animated-scrollto

Just import with <script> and global function animatedScrollTo will be available for you.

Available with Browserify

npm install animated-scrollto

In your browserify powered js:

var animatedScrollTo = require('animated-scrollto')

License

MIT

FAQs

Package last updated on 14 Aug 2014

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