skrollr-menu
skrollr-menu copied to clipboard
Check Active Link Href
Just a idea for check the active link by href attribute. Works with several menu containing the same links.
Usage example :
skrollr.menu.init(app.skrollr.instance, {
[...]
activeSubstract: function(link) {
var href = $(link).attr('href');
if(href == '#services') return 180;
else return 80;
},
[...]
});
$(window).scroll(function(){
$('#navigation a[href='+skrollr.menu.getActiveHref()+']').addClass('active');
});
@SuPa86000 a lot of thanks, you commit made my life for this evening a bit easier. :)
Does this change the menu links' active state while scrolling? Or just on-click?
@mishmomo
while scrolling