繁体   English   中英

Bootstrap下拉菜单无法正常工作

[英]Bootstrap dropdown not working properly

请在下面找到jsFiddle。 我正在尝试实现一个简单的Bootstrap下拉按钮,但无法实现。

有人可以让我知道我在想什么。

HTML

<div class="dropdown">
  <button class="btn 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="#">Action</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
    <li role="presentation" class="divider"></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
  </ul>
</div>

JS

$('.dropdown-toggle').dropdown();
$('#dropdownMenu1').dropdown('toggle');

请在下面找到小提琴链接:

http://jsfiddle.net/rohan2911/BVZ6G/

你的小提琴需要jQuery:

http://jsfiddle.net/isherwood/BVZ6G/1

Uncaught Error: Bootstrap requires jQuery bootstrap.min.js:6
Uncaught ReferenceError: $ is not defined 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM