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
Dropdown Sub Menus / Menu #424
Comments
|
Multiple levels of dropdowns are not coming to Bootstrap. If you need the multiple levels, you should probably try another implementation of that content. It's not a great paradigm to begin with and piling on other levels never works well for users. |
|
What i mean about Multi-Level Sub Menus are, like same things in your Menubar like: File, Edit, View, Search, Help, etc. Why is it not a great paradigm? |
|
Sub-menus / nested menus in the navigation bar is on of the first demands I hear from webdevelopers (and there customers). So please reconsider re-opening this issue. |
|
please reconsider re-opening this issue. |
|
Instead of asking someone else to make a fix, why don't you fork it and create your own solution. |
|
i will try :) , but after a little search i found that santiquiss ( https://github.com/santiquiss/bootstrap ) already create it, i will test his solution first :) |
|
It would indeed be a very useful addition, at least as a plugin or something... Has anybody got a demo on santiquis work??? |
|
+1 for nested menu's as an optional feature/add-on. |
|
To clarify... It would be nice to have "bootstrap-dropdown.js" support infinite sub-dropdowns that fly out to the "right" of the item clicked on (changes fly out direction to "left" if bumps into browser chrome). In the mean time I can manage with using a sidebar menu that implements nested Collapse tree's (bootstrap-collapse.js) with a "stacked tabs" menu for the final depth (ie. clicking on this item takes you to a page, and not any deeper in the hierarchy). Thanks for adding Collapse to v2.0.0 :-) |
|
Also going to +1 this idea even after markdotto's response to the issue. |
|
Dropdown submenu could be done with: .nav li.dropdown ul.dropdown-menu li:HOVER ul { at the end of bootstrap.css Adding "dropdown-menu" class to ul menu items |
|
big thanks to juansimp for a working solution! but still +1 for reopen, at least as an optional plugin or something |
|
juansimp or darthdeus, could you be more elaborate on the html needed for the nested dropdown menus to work? thanks in advance |
|
@tzikis the html is the same as if you're doing a simple dropdown, just add one more level |
|
Here is some sample code: |
|
@juansimp how would modify this for a button drop-down? |
|
You don't need to modify anything, just put in one more level of nested menu with the provided CSS, and it will show up as dropdown. The markup stays the same. |
|
The included CSS has things built around the .nav class. This does not apply when doing a button drop down. For example, the button drop-down sub menu html should look like this: I have modified the CSS to try to account for this. Here are my changes: However, this still is not working right |
|
+1. I have yet to see a decent OS or sufficiently complex app without it. I am all ears with regards to better paradigms that maintain an intuitive hierarchy and minimize space, but right now this IS the default paradigm. |
|
Okay, I got it working with the button drop-down. Here is the modified CSS: |
|
@stevebooks Thank you save my time! with working example. |
|
+1 to reopen issue. And thanks @juansimp for the hack. |
|
To get the little triangle right in @juansimp solution add the following .nav li.dropdown ul.dropdown-menu .dropdown-menu::before {
content: '';
display: inline-block;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right:7px solid #CCC;
border-right-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: 9px;
left: -14px;
}
.nav li.dropdown ul.dropdown-menu .dropdown-menu::after {
content: '';
display: inline-block;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right:6px solid white;
position: absolute;
top: 10px;
left: -12px;
} |
|
Thanks to @juansimp, @stevebooks, @darthdeus, and @Keynotelabs - I just needed a single subdrop to fly out right from both button groups and nav lists and the examples you provided got me going quickly. Certainly understand not wanting to maintain it as part of the toolkit, could get hairy pretty quickly. |
|
+1 to reopen |
2 similar comments
|
+1 to reopen |
|
+1 to reopen |
|
+1 here too |
|
this my code Multi-Level Sub Menus use bootstrap 2.0.1 http://peribadi.amin007.org/js/cth_bootstrap/nav-sendiri.php any comment? but only 1 level ... |
|
+1 to reopen |
|
i found in - http://jsfprimefacesblog.blogspot.com/2012/05/bootstrap-multilevel-dropdown-menu.html javascrip +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ css.submenu-show }html |
|
Not including this highly demanded feature will lead to it being poorly implemented over and over again, thus hurting the user experience in the long run. Just because it is not right for Twitter does not mean it is universally wrong. |
|
I simply pasted this in css file and multilevel submenus seem to work correctly (checked only on Chrome 18.0.1025.151). I am not a css ninja, and this probably can be an example of "poor implementation" but I needed a fast fix. .nav li.dropdown ul.dropdown-menu li:HOVER ul.dropdown-menu li:HOVER.dropdown > ul.dropdown-menu,
.nav li.dropdown ul.dropdown-menu li:HOVER ul.dropdown-menu {
display:block;
position:absolute;
left:100%;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.nav li.dropdown ul.dropdown-menu li:HOVER ul.dropdown-menu li.dropdown > ul.dropdown-menu,
.nav li.dropdown ul.dropdown-menu ul.dropdown-menu {
display: none;
float:right;
position: relative;
top: auto;
margin-top: -30px;
}
.nav li.dropdown ul.dropdown-menu .dropdown-menu::before {
content: '';
display: inline-block;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-right:7px solid #CCC;
border-right-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: 9px;
left: -14px;
}
.nav li.dropdown ul.dropdown-menu .dropdown-menu::after {
content: '';
display: inline-block;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-right:6px solid white;
position: absolute;
top: 10px;
left: -12px;
} |
|
+1 too. :) |
|
+1 to reopen |
1 similar comment
|
+1 to reopen |
|
It's already in 2.1.0-wip :). |
|
+1 to reopen |
|
Hi markdotto, Glad to know it's been implemented. Any guidance on how to use it? |
|
Has this been implemented in the latest bootstrap and how do I use it? |
|
@ckizer I belive this will be in 2.1 which is available on the 'wip' branch (work in progress) which is due to go live (production ready) on Monday 20th August: http://blog.getbootstrap.com/2012/08/13/help-test-bootstrap-2-1/ |
|
For those of you asking how to use it, have a look here and scroll to the Sub menus on dropdowns section ;) |
|
I implemented a javascript version of submenu; it seams to me compliant with standard bootstrap menu behavior. |
|
If you want your submenu to open to the left instead of the right (for example, if you have a .pull-right dropdown) then add this to dropdowns.less: // Left-opening Sub menus
// ---------------------------
.dropdown-submenu-left {
position: relative;
}
.dropdown-submenu-left > .dropdown-menu {
top: 0;
left: -100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 6px 0px 6px 6px;
-moz-border-radius: 6px 0px 6px 6px;
border-radius: 6px 0px 6px 6px;
}
.dropdown-submenu-left:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu-left > a:before {
display: block;
content: " ";
float: left;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 5px 5px 0px;
border-right-color: darken(@dropdownBackground, 20%);
margin-top: 5px;
margin-left: -10px;
}
.dropdown-submenu-left:hover > a:after {
border-right-color: @dropdownLinkColorHover;
}Hope that helps someone. Maybe it could get added to 2.1.2? |
|
+1! pls reopen and get added into 2.1.2 |
|
+1, add it to next version On Sat, Sep 22, 2012 at 5:52 AM, John notifications@github.com wrote:
|
|
+1. Native implementation is always good. :) |
|
-1. No. @markdotto you had it right when you originally claimed this is not good for users. Please do NOT add any more layers beyond the one submenu! @ everyone else: Multiple layers of dropdown menus are not good for users. If you're using Bootstrap, you're building websites for Users, not for clients, or for designers, or for anyone else. If a client wants it, let them know that they are asking for something considered to be BAD PRACTICE, and refuse to do it for them. If a designer wants it, tell them to become a real designer and start thinking about the Users, not their vain concept of prettiness. We, the developers of the web, are the final line of defence against giving the user a bad experience. Do your job! (but make sure you're having fun while you do it) |
|
stu, it's already been implemented. 90% of the time it's a bad user experience. But some of the web applications we use for charting and such require these features. It's not always a poor user experience. But I agree with you in general. I often find myself using them when I'm building a rapid prototype application for internal use, and need to mimic a desktop application. It's a personal choice, but they are useful for my projects and have been in v2.1 ––––––––––––––––––– Court Kizer On Oct 1, 2012, at 1:59 PM, Stu Basden notifications@github.com wrote:
|
|
thugsb: But if your users actually ask for it, you are out of luck with that dogma. Users will benefit if it is done properly with hoverIntents, but if it is left to the developers it will be implemented over and over again everytime in a shitty way. |
|
Markdotto has removed submenus in version 3.0. |
|
That is bad news unfortunately. I wanted to use these submenus for selecting nodes of a tree. Just out of interest: How do you guys solve the problem of selecting 1 to n entries of a taxonomy across the different devices? Back in the day you had a Tree widget with checkboxes, but in our post-pc/mobile world, this is no longer working. If even these submenus arent good enough, how do you solve it? |
|
There is an aria-haspopup attribute that works on the root node of the item that will be a submenu, but I have no idea if the bootstrap team has looked into implementing it. I was planning on testing it with BS3 to see if it worked. Sent from my Windows Phone From: grandfathamailto:notifications@github.com That is bad news unfortunately. Just out of interest: How do you guys solve the problem of selecting 1 to n entries of a taxonomy beyond the different devices. Back in the day you had a Tree widget with checkboxes, but in our post-pc/mobile world, this is no longer working. If even these submenus arent good enough, how do you solve it? — |
|
rob, @mdo clarified for me today that accessibility is not his primary concern here. |
|
Well, @mdo is not always right, and plenty of apps need submenus. Feel free to release a plugin to help, and I'll contribute. Sent from my Windows Phone From: Braden Andersonmailto:notifications@github.com rob, @mdohttps://github.com/mdo clarified for me today that accessibility is not his primary concern here. — |
|
FYI, grandfatha, you may be interested in https://github.com/silviomoreto/bootstrap-select . It doesn't allow arbitrary nesting, but it does make it easy to use dropdowns for selection, and you could at least categorize things with headings. |
Add a dummy Rails app for testing against
Is a Menu like nav buttons ever be created for bootstrap? To elaborate more, i would like to see bootstrap to include Menu like navigation w/ support for multi-level sub menus.
The text was updated successfully, but these errors were encountered: