在我的页面上,我有一个jQuery手风琴和一个鞋带旋转木马。我包括jQuery.js在bootstrap.js之前。在这种情况下,手风琴不起作用。
如果我在使用bootstrap.js之前使用jQuery.js,那么手风琴就能工作,但是旋转木马就不能工作了(这是因为jQuery没有加载)。
我已经看过了:Bootstrap.js has to load before jQuery,但我的情况并非如此。
据我所知,在jQuery.js之前加载bootstrap.js是正确的选择,但是如何使手风琴工作呢?
发布于 2016-07-20 02:28:45
有两个jquery库:
1.核心
2. UI
因此,命令是:
jquery.min.js (核心)然后:
bootstrap.min.js (有旋转木马的地方)然后,
jquery.ui.js (UI) (手风琴在这里)无论如何,我们建议在文档准备好时包装所有代码:
$(function(){
// All your code here
})试试这个,告诉我们:
<link rel="stylesheet" href="https://code.jquery.com/ui/jquery-ui-git.css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" media="screen" title="no title" charset="utf-8">
<script src="https://code.jquery.com/jquery-2.2.1.min.js"
integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"
integrity="sha256-eGE6blurk5sHj+rmkfsGYeKyZx3M4bG+ZlFyA7Kns7E="
crossorigin="anonymous"></script>https://stackoverflow.com/questions/38471313
复制相似问题