本文介绍了Bootstrap Modal 在文档加载时可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 Bootstrap 模型工作正常,除了它在文档加载时可见并且我不知道如何使初始状态不可见?
I have a Bootstrap Model working fine, except that it is visible when the document loads and I can't work out how to make the initial state invisible?
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
推荐答案
按照文档,将 hide
类添加到 modal 中.
Following documentation, add hide
class to the modal.
<div class="modal hide fade">
...
</div>
这篇关于Bootstrap Modal 在文档加载时可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!