I've been looking at Twitter's Bootstrap framework and I'm really impressed. However, I don't understand the thinking behind the way the dropdown navigation menu works.
Firstly, in order to see child links, you have to click on the parent. I can see the benefits of this, but why not have the more traditional dropdown on hover approach as the default?
Secondly, it seems that the thinking behind the Twitter Bootstrap's dropdown menu illuminates parent pages. I'm probably not explaining that very well... Say, you have a simple web page structure:
In a traditional dropdown menu structure, you'd hover over "about" and "services" and the dropdown menu containing the child links (eg "Web design", "Hosting" etc.) would appear. However, you would also be able to click on the parent page (i.e. "About" and "Services") and visit them.
With Bootstrap you can't have a parent page in the structure, you have to use the anchor tag ("#"). When you click this, you then see the pages in the dropdown. This is no good if there is a parent page. It's also not great from a semantic (what does "#" mean?) and accessibility (javascript turned off, screen readers etc) point of view.
I've probably missed something, but can someone explain the thinking behind this particularly in regards to parent pages and semantic html/accessibility?
The .dropdown class indicates a dropdown menu. To open the dropdown menu, use a button or a link with a class of .dropdown-toggle and the data-toggle="dropdown" attribute.
Creating Dropdown Menus with BootstrapYou can use the Bootstrap dropdown plugin to add toggleable dropdown menus (i.e. open and close on click) to almost anything such as links, buttons or button groups, navbar, tabs and pills nav etc. without even writing a single line of JavaScript code.
Example Explained HTML) Use any element to open the dropdown content, e.g. a <span>, or a <button> element. Use a container element (like <div>) to create the dropdown content and add whatever you want inside of it. Wrap a <div> element around the elements to position the dropdown content correctly with CSS.
It has been done this way simply because hover menus do not work well on touch screen devices.
https://github.com/twitter/bootstrap/issues/1029
The design decision was done by the folks at Twitter see http://markdotto.com/2012/02/27/bootstrap-explained-dropdowns/
If you look at the number of people that look for a solution to get hover back (some 1000 positive/ some 700000 fews as of 2017-11):
How to make Twitter Bootstrap menu dropdown on hover rather than click
you can see that the decision is not making everybody happy. Especially if you migrate web pages that have had hover menus for many years it's awkward to be "forced" to a new style by some framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With