Bootstrap无法弹出模态框的解决办法
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Bootstrap无法弹出模态框的解决办法,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3220字,纯文字阅读大概需要5分钟。
内容图文
<! DOCTYPE html > < html lang ="en" > < head > < meta charset ="UTF-8" > < title >Title</title><link rel="stylesheet" href="/static/plugins/bootstrap/css/bootstrap.css"><link rel="stylesheet" href="/static/plugins/font-awesome/css/font-awesome.css"></head><body><div class="container"><div style="padding: 20px 0"><a href="" class="btn btn-primary" data-toggle=‘modal‘ id="addBtn">添加</a> //a标签需要设置弹出对话框时,需要提前添加 data-toggle=‘modal‘ <a href="" class="btn btn-danger">删除</a></div><div ><table class="table table-bordered"><thead ><tr><th>ID</th><th>姓名</th><th>年龄</th><th>性别</th><th>班级</th><th>操作</th></tr></thead><tbody class="table table-striped"><tr ><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td class="text-center"><a href="" class="glyphicon glyphicon-remove"></a><a href="" class="fa fa-eraser"></a></td></tr><tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td class="text-center"><a href="" class="glyphicon glyphicon-remove"></a><a href="" class="fa fa-eraser"></a></td></tr> {% for row in stu_list %} <tr ><td>{{ row.id }}</td><td>{{ row.username }}</td><td>{{ row.age }}</td><td> {# {{ row.gender }}#} {% if row.gender == 1 %} <div>男</div> {% elif row.gender == 0 %} <div>女</div> {% endif %} </td><td> {{ row.cs.titile }} </td><td class="text-center"><a href="" class="glyphicon glyphicon-remove"></a><a href="" class="glyphicon glyphicon-pencil"></a></td></tr> {% endfor %} </tbody></table></div></div><!-- Modal --><div><div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button><h4 class="modal-title" id="myModalLabel">Modal title</h4></div><div class="modal-body"> ... </div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button><button type="button" class="btn btn-primary">Save changes</button></div></div></div></div></div><script src="/static/js/jquery-3.3.1.js"></script><script src="/static/plugins/bootstrap/js/bootstrap.js"></script><script> $(‘#addBtn‘).click(function () { $(‘#addModal‘).modal(‘show‘) }) </script></body></html>
用a标签弹出对话框时,需要在a标签内添加 data-toggle = ‘modal‘,,否则,点击a标签是,模态对话框会瞬间消失
原文:https://www.cnblogs.com/lhqlhq/p/9165398.html
内容总结
以上是互联网集市为您收集整理的Bootstrap无法弹出模态框的解决办法全部内容,希望文章能够帮你解决Bootstrap无法弹出模态框的解决办法所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。