javascript - Unable to use bootstrap.min.js and bootstrap-dropdown.js at the same time - Stack Overflow

I'm using modal and dropbox js of twitter bootstrap in my project and having problem using the two

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744766937a4592518.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信