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

♀尐吖头ヾ 提交于 2019-12-02 23:39:10

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

Mark Otto (@mdo), one of the main developers of Bootstrap, answered on his blog:

http://www.markdotto.com/2012/02/27/bootstrap-explained-dropdowns/

There are many CSS and js hacks out there for this functionality, but all of them is breaking something.

I am against using hover, but if someone really needs that, then do it properly. I made a plugin which is using only the Bootstrap javascript API without any hack, so it works on all devices, without braking the usability:

https://github.com/istvan-ujjmeszaros/bootstrap-dropdown-hover

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!