- 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 after the scroll is complete: $(‘a’).smoothScroll({afterScroll: function() { window.location.hash = this.hash; }});
- No history/back-button management