引导模式问题(无法显示第二个模式)
Bootstrap modal issue (not able to show the second modal)
所以我有两个模式,它们是根据我点击的按钮触发的
第一个是这样触发的:
<a id="de_details" data-toggle="modal" data-target=".show-de-banks"> </a>
它是这样构建的
<div class="modal fade show-de-banks" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
bla bla
<div class="modal-body">
bla bla
</div>
<div class="modal-footer">
bla bla
</div>
</div>
</div>
</div>
第二个使用按钮调用:
<button class="btn btn-warning" data-toggle="modal" data-target=".open-dialog">Open dialog with IT-Team</button>
它是以同样的方式构建的:
<div class="modal fade open-dialog" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
dsfgdfg
</div>
<div class="modal-body">
sdgfsdgsd
</div>
<div class="modal-footer">
sdfds
</div>
</div>
</div>
</div>
当我打开第一个时,我没有问题。
但当我想打开第二个时,它一出现就消失了。
我知道:
- 我只需要包含一个js引导文件
- 我的脚本必须在最后(为了页面快速加载)
我错过什么了吗?
正如Ubiquitous Developers Bootstrap模态问题(无法显示第二个模态)的评论所说,您应该将按钮type
作为button
<button type="button" class="btn btn-warning" data-toggle="modal" data-target=".open-dialog">Open dialog with IT-Team</button>
这是一个老问题,但我遇到了同样的问题并发现了这个问题。
在您的第一个模态中,具有类modal-header
的div
没有闭合——您缺少了一个</div>
。
这意味着第二个模态将在第一个模态内部,这会导致问题。
我通过查看Chrome F12工具的元素选项卡发现了这个问题,它很好地显示了这样的问题。
相关文章:
- 缩略图单击时图像未以模式显示
- 模式显示文本区域内容不是字符串
- 在ajax回调(safari)中调用bootstrap模式显示
- Twtitter Bootstrap模式显示事件多次触发
- 以引导模式显示表单结果
- 引导模式显示,但没有可见文本
- 无法在提交时获取引导模式显示
- 提交表单后,将引导模式显示为“谢谢”
- 使用reactjs、localStorage和state(遍历)以模式显示表中的数据
- XPages-以读取模式显示附件
- JavaScript在验证后切换模式显示
- Jquery Cookie通过模式显示/隐藏菜单
- Rails Rendering从索引页以Bootstrap模式显示
- 强制网站仅以横向模式显示
- 如何使用单一模式显示多个图像
- 链接JavaScript不工作时,Bootstrap模式显示
- 引导模式显示不会移除隐藏属性
- Google Maps API v3 + Foundation 4 Reveal模式显示不正常
- 引导模式显示和隐藏在操作中
- 将JqGrid列模式显示为日期,超链接显示NAN/NAN/NAN