bootstrap中的modal无法正常使用

coder_xsy 2017-10-27 09:18:27
这个是引用(都是在一个html文件中)
<script src = "jquery-3.2.1.min.js"></script>
<link rel="stylesheet" href="bootstrap.css">
<stript src = "popper.min.js"></stript>
<script src="bootstrap.js"></script> (都是官网 上下的,不过是bootstrap4.0)
这是modal这部分的代码
<div class = "row">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</div>
代码如上,但是用chrome浏览器打开html文件之后点击对应的button,没有反应呢?求大佬们解答!已经困惑了一个礼拜,还没搞好,有点急
...全文
979 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
coder_xsy 2017-11-01
  • 打赏
  • 举报
回复
关于具体的JS调用能具体点吗?
webkubor 2017-10-31
  • 打赏
  • 举报
回复
模态框还需要单另进行js调用 $('#XXXX').modal('show');
jio可 2017-10-31
  • 打赏
  • 举报
回复
模态框需要这个(popper.min.js)文件?
coder_xsy 2017-10-31
  • 打赏
  • 举报
回复

这样之后还是没有效果,console中显示找不到popper.js,但是不是已经添加了吗?
当作看不见 2017-10-28
  • 打赏
  • 举报
回复
把 js代码放在HTML代码的后面.包括js的引用..如果还不行,F12 看一下控制台有没有报错,贴上来看看

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧