
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
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 3,656 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.