scroll-manager
A handler for scrolling inside elements with different eases
Take a look to the demo --> Demo
var ScrollManager = ;thisscroller = ; var elementTo = document;var { console;}; var options = duration: 08 to: elementTooffsetTop element: documentbody ease: 'easeLinear'; thisscroller;
Examples
ScrollToElement
//If you want to scroll to an element without using the offset you can use:var element = document;thisscroller;
ScrollTo
//This scroll the element to the offsetToScroll in the required duration with the default easethisscroller; //This scroll the element to the offsetToScroll in the required duration with the selected ease and finally execute the callbackthisscroller;
Horizontal
//You also can use the method scrollTo to scroll horizontal in the element, you only need to set the direction thisscroller;
ScrollTop
//This scroll the element to the top in the required duration with the selected ease and finally execute the callbackthisscroller;
ScrollBottom
//This scroll the element to the bottom in the required duration with the default easethisscroller;
ScrollRight
//This scroll the element to the right of an element in the required duration with the selected ease and finally execute the callbackthisscroller;
ScrollLeft
//This scroll the element to the left of an element in the required duration with the default easethisscroller;
ScrollEqual
//If you want to scroll with the same velocity without taking into acount the duration you can use:thisscroller; //This is useful if you want the user feel the difference between short and long distances.
Available Eases
'easeLinear'
'easeInQuad'
'easeOutQuad'
'easeInOutQuad'
'easeInCubic'
'easeOutCubic'
'easeInOutCubic'
'easeInExpo'
'easeOutExpo'
'easeInOutExpo'
'easeInCirc'
'easeOutCirc'
'easeInOutCirc'
Note: If you dont choose any ease, easeLinear is going to be run.