
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
scrollto-with-animation
Advanced tools
Animated scroll with requestAnimationFrame. For smooth animate scrollTo defining the easing, running at 60FPS and cross-browser
### Live demo
npm install scrollto-with-animation --save
var scrollToWithAnimation = require('scrollto-with-animation')
// or ES6+
import scrollToWithAnimation from 'scrollto-with-animation'
<script src="https://unpkg.com/scrollto-with-animation/dist/scrollto-with-animation.min.js"></script>
scrollToWithAnimation(
document.documentElement, // element to scroll
'scrollTop', // direction to scroll
0, // target scrollY (0 means top of the page)
10000, // duration in ms
'easeInOutCirc', /*
Can be a name of the list of 'Possible easing equations' or a callback
that defines the ease. # http://gizma.com/easing/
*/
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).
## Options
linearTween
easeInQuad
easeOutQuad
easeInOutQuad
easeInCubic
easeOutCubic
easeInOutCubic
easeInQuart
easeOutQuart
easeInOutQuart
easeInQuint
easeOutQuint
easeInOutQuint
easeInSine
easeOutSine
easeInOutSine
easeInExpo
easeOutExpo
easeInOutExpo
easeInCirc
easeOutCirc
easeInOutCirc
Feel free to add more ease functions to easings.js open a Pull request!
MIT
FAQs
Animated scroll with requestAnimationFrame. For smooth animate scrollTo defining the easing, running at 60FPS and cross-browser
The npm package scrollto-with-animation receives a total of 2,887 weekly downloads. As such, scrollto-with-animation popularity was classified as popular.
We found that scrollto-with-animation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.