question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need dropdown menu parent link in navbar to open the submenu on hover and lead to <a href="/example-page"> on click

See original GitHub issue

I am having issues with the dropdown navigation menu.

Problem is that currently to allow the dropdown js to work, the parent link of the dropdown menu is marked up has to either be marked up as:

<a class="dropdown-toggle" data-toggle="dropdown" href="/example-page" data-target="#"> or <a class="dropdown-toggle" data-toggle="dropdown" href="/example-page/#">

However, I need the parent link to lead to it’s href on-click! When the dropdown js is enabled on the menu, the parent link needs to be clicked to open the submenu and this probably conflicts with the on-click hyperlink function of the parent.

I need to know if it’s possible to open the submenu by hovering over the parent link instead…so that clicking the parent link can be used as a link itself.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
codecahillcommented, Nov 27, 2012

Just add “disabled” as a class on your anchor:


    a class="dropdown-toggle disabled" href="http://google.com"
0reactions
bipin-xitcommented, Sep 14, 2012

But the parent link is not clickable even after applying the same fix? Is any idea how to make it clickable?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display Submenus on hover and open link on Click
You need to start submenu <ul> inside parent menu li . Here is an example: .dropdown-menu { position: relative; display: none; } ...
Read more >
How to Open Bootstrap Dropdown Menu on Hover Rather ...
Answer: Use the jQuery hover() method. By default, to open or display the dropdown menu in Bootstrap you have to click on the...
Read more >
How To Create a Subnavigation Menu - W3Schools
Subnav/dropdown menu inside a Navigation Bar. Hover over the "about", "services" or "partners" link to see the sub navigation menu.
Read more >
Menu: Hover dropdowns + parent links + mobile friendly
Hi,. the following pieces of code change the default behaviour of the Customizr theme menu : 1 displays the dropdown items on hover...
Read more >
Dropdown menus: Should the parent item be clickable?
In my opinion, the parent element (that which when hovered spawns the dropdown menu) MUST be clickable. Other items in the global navigation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found