Minimal js scrolling module.
bower install b_scrollTo -S
//Scroll to window y-position of 300px.
require(['b_scrollTo']){
$.scrollToPixel(300);
};
//With default animation duration of 500ms.
$.scrollToPixel(100);
//With specific animation duration of 1s.
$.scrollToPixel(100, 1000);
//If it should not be animated
$.scrollToPixel(100, 0);
//OR
$.scrollToPixel(100, false);
$.scrollTo(element);
//OR
$(element).scrollTo();
//With a specific animation duration of 300ms.
$.scrollTo(element, 300);
//OR
$(element).scrollTo(300);
//Without animation
$.scrollTo(element, 0);
//OR
$.scrollTo(element, false);
//OR
$(element).scrollTo(0);
//OR
$(element).scrollTo(false);
//With a specific offset and the default duration. E.g. if you have an header with a height of 200px.
$.scrollTo(element, null, 200);
//OR
$(element).scrollTo(null, 200);
$.scrollToPixel(400).done(function(){
//Do something . . .
});