twitter-bootstrap Bootstrap 3.0 模态
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17575687/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bootstrap 3.0 Modal
提问by Eric
I am stuck. Given Bootstrap 3.0 is about to be released, I decided to go with it for a new project. Things are going fine so far, but for the life of me, I can't figure out how to do a Modal Dialog in Bootstrap 3.0.
我被困住了。鉴于 Bootstrap 3.0 即将发布,我决定将其用于一个新项目。到目前为止一切顺利,但对于我的生活,我无法弄清楚如何在 Bootstrap 3.0 中进行模态对话框。
Does anyone have a simple example?
有人有一个简单的例子吗?
回答by Bass Jobsen
You could try to build the docs: Compile Twitter bootstrap 3 docs (How to)?so also http://bassjobsen.weblogs.fm/explore-and-install-twitter-bootstrap-3/from the docs:
您可以尝试构建文档:Compile Twitter bootstrap 3 docs (How to)?来自文档的http://bassjobsen.weblogs.fm/explore-and-install-twitter-bootstrap-3/也是如此:
<!-- Button trigger modal -->
<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">Launch demo modal</a>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">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><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
回答by Joe
I've found a very well example that as well let you download a zip with all the code examples about Booststrap 3 Modal.
我找到了一个很好的示例,它也可以让您下载包含有关 Booststrap 3 Modal 的所有代码示例的 zip。
I hope this help you as well!
我希望这也能帮助你!
回答by Jithin Vijayan
You can try simpleDialog. This is a simple bootstrap modal with callbacks and template injection options.
你可以试试simpleDialog。这是一个简单的引导模式,带有回调和模板注入选项。
回答by mcarra66
I've been fighting against the same problem and thanks to this conversation I found my mistake. While using TwitterBootstrap3, you need the following things:
我一直在与同样的问题作斗争,多亏了这次谈话,我发现了我的错误。使用 TwitterBootstrap3 时,您需要以下内容:
A button trigger
一个按钮触发器
<a data-toggle="modal"
href="#myModal"
class="btn btn-primary btn-lg"
>Launch demo modal</a>
An a div with this minimun structure:
具有这种最小结构的 div:
<div class="modal fade"
id="myModal"
tabindex="-1"
role="dialog"
aria-labelledby="myModalLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<!-- blah blah content here -->
</div>
</div>
</div>
It is important to know that if you don't place modal-dialog and model-content, the modal window will not be opened properly
需要注意的是,如果不放置modal-dialog和model-content,模态窗口将无法正常打开

