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.

Share Improve this question edited Jul 14, 2013 at 3:38 Bryan Hanson asked Jul 14, 2013 at 3:01 Bryan HansonBryan Hanson 6,2234 gold badges44 silver badges80 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

From 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