admin管理员组文章数量:1252697
New to bootstrap and javascript
and was trying to build a fairly minimal example of a dropdown menu. I am using bootstrap 2.3.2
which is the current version. My css
and js
are visible in my IDE. From the bootstrap
docs it seems that a standard install of bootstrap.js
contains bootstrap-dropdown.js
and I can see it in the file. Yet, I need to have the following for the drop down menu to work:
<script src=".js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src=".js"></script>
Why do I have to load bootstrap-dropdown.js
separately if it is included in bootstrap.js
? Obviously there is something fundamental here that I don't understand. Thanks.
New to bootstrap and javascript
and was trying to build a fairly minimal example of a dropdown menu. I am using bootstrap 2.3.2
which is the current version. My css
and js
are visible in my IDE. From the bootstrap
docs it seems that a standard install of bootstrap.js
contains bootstrap-dropdown.js
and I can see it in the file. Yet, I need to have the following for the drop down menu to work:
<script src="http://code.jquery./jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/bootstrap.js"></script>
<script src="http://twitter.github./bootstrap/assets/js/bootstrap-dropdown.js"></script>
Why do I have to load bootstrap-dropdown.js
separately if it is included in bootstrap.js
? Obviously there is something fundamental here that I don't understand. Thanks.
1 Answer
Reset to default 10From Bootstrap website :
Plugins can be included individually (though some have required dependencies), or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.
Both bootstrap.js
and bootstrap.min.js
contain all plugins in a single file. you do not need the bootstrap-dropdown.js
if you include bootstrap.min.js
or bootstrap.js
from the bootstrap page, check this overview on Bootstrap site. i can see that you are including both bootstrap.min.js
and bootstrap.js
but only one is enough.
Check the demo here, only using bootstrap.js
.
Also, you can download a customized version from here, just according to your need you can add ponents/plugins and then download the custom build.
本文标签: javascriptNeed to load bootstrapdropdownjs after bootstrapjs to make dropdown workwhyStack Overflow
版权声明:本文标题:javascript - Need to load bootstrap-dropdown.js after bootstrap.js to make dropdown work - why? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740318258a2260728.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论