admin管理员组

文章数量:1391850

I'm using modal and dropbox js of twitter bootstrap in my project and having problem using the two.
I have added the following script tags in my html -
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-dropdown.js"></script>

Now, if I keep both tags, dropdown js does not work but if I remove the first one, dropdown works but I cannot use modal. Is adding a separate js for modal dialog i.e bootstrap-modal.js is the only solution or am I missing something here?

I'm using modal and dropbox js of twitter bootstrap in my project and having problem using the two.
I have added the following script tags in my html -
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-dropdown.js"></script>

Now, if I keep both tags, dropdown js does not work but if I remove the first one, dropdown works but I cannot use modal. Is adding a separate js for modal dialog i.e bootstrap-modal.js is the only solution or am I missing something here?

Share Improve this question asked May 24, 2013 at 3:38 priteshbaviskarpriteshbaviskar 2,3372 gold badges21 silver badges30 bronze badges 2
  • 1 Both bootstrap.js and bootstrap.min.js contain all plugins in a single file. you do not need the dropdown.js if you include bootstrap.min.js – G-Man Commented May 24, 2013 at 3:42
  • 2 You can also make a custom bootstrap[.min].js file, with only the necessary plugins. – Qantas 94 Heavy Commented May 24, 2013 at 3:43
Add a ment  | 

2 Answers 2

Reset to default 6

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

From the bootstrap page http://twitter.github.io/bootstrap/javascript.html

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. I also face the same problem sometimes. Sometime its difficult to predict the behavior of scripts with twitter bootstrap. Like there is plugin for dropdown in bootstrap.js but still not working. if you include separate dropdown.js then there is no issue

本文标签: javascriptUnable to use bootstrapminjs and bootstrapdropdownjs at the same timeStack Overflow