Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was the thinking behind the implementation of the dropdown menu in Twitter Bootstrap? [closed]

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:

  • Home
  • About
    • The Team
  • Services
    • Web Design
    • Hosting
    • Domains
  • Contact

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?

like image 965
iagdotme Avatar asked Feb 24 '12 15:02

iagdotme


People also ask

Which of the following bootstrap classes are used to add a dropdown menu?

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.

Can we create drop down menu using buttons with bootstrap custom style?

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.

How do I display a dropdown?

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.


2 Answers

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

like image 155
Chris Foster Avatar answered Oct 11 '22 23:10

Chris Foster


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.

like image 1
Wolfgang Fahl Avatar answered Oct 12 '22 00:10

Wolfgang Fahl