smartscroll
smartscroll copied to clipboard
Add navigation
Hi,
would like to see this in this plugin. A navigation that refers to the right hashes and the links should get an is-active status when they hit the section.
Here's a snippet of my last implementation of it (no active status is added when the section is hit at the moment):
/// Navigation Scroll
/////////////////////////////////////////////////////////////
var _navHeaderLink = $('.nav-main_item-link');
_navHeaderLink.each(function(i, elm) {
var _link = $(elm);
_link.click(function(e) {
e.preventDefault();
var _linkHash = $(this).data('hash-jump');
// Scroll to the section
$('html, body').animate({
scrollTop: $(_linkHash).offset().top
}, 600, 'easeInQuart')
})
});
+1 I'm exactly trying to do the same. Would be cool to have it as a built-in functionality
+1 for this feature. Navigation that scrolls to that section is a common use-case.
+1