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

前端 未结 4 868
半阙折子戏
半阙折子戏 2021-02-03 21:17

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.

相关标签:
4条回答
  • 2021-02-03 22:07

    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

    0 讨论(0)
  • 2021-02-03 22:11

    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

    0 讨论(0)
  • 2021-02-03 22:17

    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.

    0 讨论(0)
  • 2021-02-03 22:19

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

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

    0 讨论(0)
提交回复
热议问题