Animated Scrollto
Animated scrolling without any dependency on libraries
Install / Use
npx skills add madebysource/animated-scrolltoInstalls into whichever agent you are using.
README
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 browserify/webpack.
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).
Import as an external script
Just import this library with <script> and global function animatedScrollTo will be available for you.
Available with Browserify
npm install animated-scrollto
In your browserify/webpack powered js:
var animatedScrollTo = require('animated-scrollto')
License
MIT
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.7kCommit, push, and open a PR
