Smooth scrolling in all browsers
$(function () { $.srSmoothscroll({ // defaults step: 55, speed: 400, ease: 'swing', target: $('body'), container: $(window) }) })
See this example
lorem ipsum
lorem ipsum
#container1 { width: 500px; height: 300px; overflow: auto; } #container2 { width: 500px; height: 300px; overflow: auto; }
$(function () { $.srSmoothscroll({ target: $('#widget1'), container: $('#container1') }) $.srSmoothscroll({ target: $('#widget2'), container: $('#container2') }) })
Browsers that support smooth scrolling natively may be excluded.
$(function () { var platform = navigator.platform.toLowerCase(); if (platform.indexOf('win') == 0 || platform.indexOf('linux') == 0) { if ($.browser.webkit) { $.srSmoothscroll(); } } });
This will enable simplr-smoothscroll only for webkit browsers on windows and linux.