Smooth Scroll jQuery Plugin automatically makes same-page links scroll smoothly.
$.fn.smoothScroll:
- Allows for easy implementation of smooth scrolling for same-page links.
- Works like this:
$('a').smoothScroll();
- Specify a containing element if you want:
$('#container a').smoothScroll();
- Exclude links if they are within a containing element:
$('#container a').smoothScroll({excludeWithin: ['.container2']});
- Exclude links if they match certain conditions:
$('a').smoothScroll({exclude: ['.rough','#chunky']});
- Adjust where the scrolling stops:
$('.backtotop').smoothScroll({offset: -100});
- Add a callback function that is triggered before the scroll starts: `$('a').smoothScroll({beforeScroll: function() { alert('ready to go!'); }});
- Add a callback function that is triggered after the scroll is complete:
$('a').smoothScroll({afterScroll: function() { alert('we made it!'); }});
- Add back button support by including a history management plugin.
Please login to continue.