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
EXAMPLE
var scrollToElement = ; ; // with options; // or if you already have a reference to the elementvar elem = document;;
LICENSE
MIT