问答详情
源自:2-4 下拉菜单--JavaScript触发方法

无法隐藏下拉菜单

去掉a标签的data-toggle="dropdown"属性后,只用的dropdown函数无法隐藏下拉菜单

提问者:随风独醉 2015-01-16 16:58

个回答

  • 花花丹
    2015-08-05 09:53:11
    已采纳

    Bootstrap官网用法:http://getbootstrap.com/javascript/#dropdowns

    原文如下:

    data-toggle="dropdown" still required

    Regardless of whether you call your dropdown via JavaScript or instead use the data-api, data-toggle="dropdown" is always required to be present on the dropdown's trigger element.

    即不能去掉data-toggle="dropdown"