Make parent <li> a link, navigate and expand children upon clicking.
See original GitHub issueIs this doable? The current behavior will ignore any <a href="www.link.com">
placed inside the parent <li>
tag and just expand the list. It would be great for each list item to have the capability to have a link AND an expand button.
Issue Analytics
- State:
- Created 9 years ago
- Comments:30 (4 by maintainers)
Top Results From Across the Web
Menu : expand child UL on parent LI click and disable link
Problem is that i have links to subpages on parent LI, which needs to be disabled so they don't redirect to subpage, but...
Read more >In Praise of the Unambiguous Click Menu - CSS-Tricks
Building click menus · The element you click to show the submenu should be a <button> since it doesn't link to a page....
Read more >How to get the child element of a parent using JavaScript
Select an element whose child element is going to be selected. Use .children property to get access of all the children of the...
Read more >Accessible Navigation with Drupal Core's Menu System
In addition to indicating the state, you need to create a relationship between the parent <button> element and its child <ul> submenu element....
Read more >How make top level menu item not have link, but have sub ...
1) Make the parent menu item a duplicate of the first sub-item, and change its label. For example, if the first item under...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would like the exact same functionality. When I click an expanding-menu, I want the menu to expand also to be redirecting to a page. In some cases, I would like to make sublinks like @adi10ain is doing. In other cases, I would like something like the following, where when I click the top-level menu item, it takes me to to the top of the page “link.html”, and the sub-menu items provide links to bookmarks elsewhere on link.html
I found a kind of work-around. How easy this is depends on what engine you’re using to create your site. I’m using Flask, so it’s pretty easy with blocks. On your main page (page1.html), you just include a link to the other page (page2.html) in the menu, with no sub-menu options. Then on the page2.html, include the sub-menus in the menu definition
page1.html
page2.html