时间:2022-11-25 10:39:40 | 栏目:JavaScript代码 | 点击:次
先给大家说下我的实现思路:给div一个class “dropdown”,将下拉菜单放在这个div里就可以显示bootstrap的下拉菜单。
<div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Regular link</a></li> <li role="presentation" class="disabled"><a role="menuitem" tabindex="-1" href="#">Disabled link</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another link</a></li> </ul> </div>