我为引导按钮下拉创建了一个示例:
<!DOCTYPE html>
<html>
<head>
<title>Button</title>
<link rel="stylesheet" href="stylesheets/bootstrap.css"/>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
</head>
<body>
<div class="btn-group">
<button class="btn btn-success">Action</button>
<button class="btn btn-success dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="">HI</a></li>
<li><a href="">BYE</a></li>
</ul>
</div>
</body>
</html>
这个例子运行良好。但是当我在我的 rails 3 应用程序中创建相同的下拉菜单时不起作用。这是我的代码:在 Application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Accounting-ProfitBooks</title>
<%= stylesheet_link_tag 'style','custom','report','jquery-ui' %>
<%= stylesheet_link_tag 'jquery.ui.datepicker' %>
<%= stylesheet_link_tag 'ui.dropdownchecklist' %>
<%= stylesheet_link_tag "jquery-1.7.2-ui.css" %>
<%= javascript_include_tag "jquery-1.4.2.min", "jquery-1.8.1.ui.min", "jsapi" %>
<%= stylesheet_link_tag "zendesk.css" %>
<%= javascript_include_tag "zendesk.js" %>
<%= stylesheet_link_tag "bootstrap.css" %>
<%= javascript_include_tag "bootstrap.js"%>
<%= javascript_include_tag "bootstrap.min.js"%>
<%= javascript_include_tag "bootstrap-dropdown.js"%>
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'jquery-1.6.4.min.js',"jquery-1.8.ui.min.js" %>
<%= javascript_include_tag 'jquery.ui.core.min' %>
<%= javascript_include_tag 'ui.dropdownchecklist' %>
<%= javascript_include_tag 'jquery.ui.widget.min' %>
<%= javascript_include_tag 'jquery.ui.tabs.min' %>
<%= javascript_include_tag 'jquery.tipTip.min' %>
<%= javascript_include_tag 'jquery.ui.datepicker' %>
<%= javascript_include_tag 'jquery.ui.autocomplete.min' %>
<%= javascript_include_tag 'jquery.superfish.min' %>
<%= javascript_include_tag 'jquery.supersubs.min' %>
<%= javascript_include_tag 'jquery.validate_pack' %>
<%= javascript_include_tag 'jquery.nyroModal.pack' %>
<%= javascript_include_tag 'jquery.dataTables.min' %>
<%= javascript_include_tag 'nested_form' %>
<%= javascript_include_tag 'best_in_place' %>
<%= javascript_include_tag 'colortip-1.0-jquery.js'%>
<%= javascript_include_tag 'script.js'%>
<%= csrf_meta_tag %>
</head>
这是我的html:
<div class="btn-group">
<button class="btn btn-success">Action</button>
<button class="btn btn-success dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="">HI</a></li>
<li><a href="">BYE</a></li>
</ul>
</div>
我认为他们是我的 jquery 的问题,但我无法跟踪,任何帮助将不胜感激。