Scroll To Element
Smooth scrolling to an element via selector or node reference
Install / Use
npx skills add willhoag/scroll-to-elementInstalls into whichever agent you are using.
README
scroll-to-element
Smooth scrolls to element of the specified selector or element reference with optional offset, scroll-positon, easing, and duration. Takes into account document height for elements low on the page.
scrollToElement(selector, <options>)
Valid options:
offset : number
Add an additional offset to the final position. if > 0 then page is moved to the bottom otherwise the page is moved to the top.
align : string
Alignment of the element in the resulting viewport. Can be one of
'top','middle'or'bottom'. Defaulting to'top'.
ease : string
Easing function defaulting to "out-circ" (view ease for more)
duration : number
Animation duration defaulting to
1000
Callback support
scrollToElement emits an
endevent when the scroll animation is complete, and can be optionally consumed to perform a callback.
EXAMPLE
var scrollToElement = require('scroll-to-element');
scrollToElement('#id');
// with options
scrollToElement('.className', {
offset: 0,
ease: 'out-bounce',
duration: 1500
}).on('end', () => {
console.log('Done scrolling!');
});
// or if you already have a reference to the element
var elem = document.querySelector('.className');
scrollToElement(elem, {
offset: 0,
ease: 'out-bounce',
duration: 1500
});
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

