简体   繁体   中英

Couple of links not working inside a sticky Navigation Menu

This is the website, http://girleducationproject.com/tempfile.html[1] The links in the navigation are all to anchors within the page except for the donate button and the donate link. Clicking these two doesn't work but if right clicked they give the option to open link in new tab. Please Advise. Thanks

The problem is that you have bound a click event to all navigation items via onePageNav plugin.

In your main.js add a filter in your navigation function:

// One Page Navigation
Navigation: function () {
    $('#menu').onePageNav({
        currentClass: 'current',
        scrollSpeed: 500,
        scrollOffset: 60,
        scrollThreshold: 0.2,
        easing: 'swing',
        filter: ':not(.external)' // <-- ADD THIS LINE
    });
},

Then, add a "external" class to your external links. Should solve it.

Another example is found in the docs (see Filter Example ): https://github.com/davist11/jQuery-One-Page-Nav#filter-example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM