0

I have a bootstrap navbar solution with an hover dropdown. It's something like this: http://bootsnipp.com/snippets/E7KEy

My problem is, that I need clickable links in the navbar. Every dropdown parent should be a link. At the moment, the "dropdown-toggle" class didn't allow this.

In the mobile view, I need an extra link to open the dropdown because the parent item should stay clickable.

Are there any ideas for a solution?

2 Answers 2

1

One of the options is to use jQuery to show submenus; In a similar way how bootstrap loads menus.

Following is the code to do so and it worked very well for me:

$('ul.nav li.dropdown, li.dropdown-submenu').hover(function () {
    $('> .dropdown-menu', $(this)).stop(true, true).delay(1000).show();
    $(this).addClass('open');
}, function () {
    $('> .dropdown-menu', $(this)).stop(true, true).delay(1000).hide();
    $(this).removeClass('open');
});
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry, what makes this the best option?
1

In css file on line number 55 change replace it with this code.

.navbar-default .navbar-nav .open .dropdown-menu > li > a:click,
.navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
 background-color: #ccc;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.