无法同时使用 bootstrap.min.js 和 bootstrap-dropdown.js [英] Unable to use bootstrap.min.js and bootstrap-dropdown.js at the same time

查看:46
本文介绍了无法同时使用 bootstrap.min.js 和 bootstrap-dropdown.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用了 twitter bootstrap 的 modal 和 dropbox js,但在使用这两者时遇到了问题.
我在我的 html 中添加了以下脚本标签 -
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-dropdown.js"></script>

现在,如果我保留两个标签,下拉 js 不起作用,但如果我删除第一个,下拉有效,但我不能使用模态.是否为模态对话框添加单独的 js,即 bootstrap-modal.js 是唯一的解决方案,还是我在这里遗漏了什么?

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?

推荐答案

bootstrap.js 和 bootstrap.min.js 都在一个文件中包含所有插件.如果包含 bootstrap.min.js,则不需要 bootstrap-dropdown.js

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

从引导页面http://twitter.github.io/bootstrap/javascript.html

这篇关于无法同时使用 bootstrap.min.js 和 bootstrap-dropdown.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆