-
Notifications
You must be signed in to change notification settings - Fork 0
scrollToY
Mike Byrne edited this page Jan 25, 2022
·
2 revisions
Scroll to a y position
- nothing
options object:
- options.el - required - node or document to scroll
- options.offset - required - number, final scroll to position
- options.duration - optional - ms, defaults to 250
- options.easing - optional - "linear" (default) | "easeIn" | "easeOut" | "easeInOut"
- options.onComplete - optional - function to run on complete
- nothing
scrollToY({
el: document,
offset: 1000,
duration: 250,
easing: "linear"
});
scrollToY({
el: document.getElementById("scroll_div"),
offset: getOffset(document.getElementById("scrollable_content_bottom")).top,
duration: 500,
easing: "easeInOut",
onComplete: function(){
console.log("complete!");
}
});