Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nav not switching to active #24

Open
ivo1981 opened this issue Mar 29, 2017 · 1 comment
Open

nav not switching to active #24

ivo1981 opened this issue Mar 29, 2017 · 1 comment

Comments

@ivo1981
Copy link

ivo1981 commented Mar 29, 2017

Hi,
I'm having some trouble with the menu's. I think some scripting is missing.
I am using the cover template an my menu looks like this:

ul.nav.masthead-nav
    li.active
	a(href="/#") Home
    li
	a(href="/#features") Features
   li
	a(href="/documetation") Documentation
   li
	a(href="/control") Control
   li
	a(href="/technical") Technical
   li
	a(href="/#contact") Contact

The hover functions are working correctly(css), however the active tabs are not switching on clicking or scrolling.

I tried adding code to fix the menu:

append scripts
    script.
$(document).ready(function () {
    $('.nav li a').click(function(e) {

        $('.nav li').removeClass('active');

        var $parent = $(this).parent();
        if (!$parent.hasClass('active')) {
            $parent.addClass('active');
        }
        e.preventDefault();
    });
});

This fixes the menu, but breaks the links.

I want to achieve the effect you have on the rightside menu on http://rajasegar.github.io/JADE-Bootstrap/components.html

Any help would be appriciated.
Ivo

@ivo1981
Copy link
Author

ivo1981 commented Mar 29, 2017

I found the source, but don't know how to fix it.
the problem is scrollspy.
_bootstap.jade has a target of .scrollspy,
so I tried adding that to the ul like so:
ul.nav.masthead-nav.scrollspy
but without any result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant