skrollr-menu icon indicating copy to clipboard operation
skrollr-menu copied to clipboard

Check Active Link Href

Open SuPa86000 opened this issue 11 years ago • 3 comments

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 avatar Oct 28 '13 22:10 SuPa86000

@SuPa86000 a lot of thanks, you commit made my life for this evening a bit easier. :)

shelby-carter avatar May 27 '14 14:05 shelby-carter

Does this change the menu links' active state while scrolling? Or just on-click?

monicaaikorice avatar Aug 05 '14 22:08 monicaaikorice

@mishmomo

while scrolling

shelby-carter avatar Aug 06 '14 04:08 shelby-carter