我如何在Twitter引导中拥有两种不同的模态
How can I have two different Modals in Twitter Bootstrap
因此,如果我有两个不同的模型,则第二个模型中的内容不会显示,而是第一个模型的内容。如何获得两个具有不同内容的独立模型
示例模型 1:
<!-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">modal 1</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" 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>
示例模型 2:
<!-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn btn-danger" data-toggle="modal">modal 2</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" 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">this is different</h3>
</div>
<div class="modal-body">
<p>this ones different but yet when you click it the content of the first Model appears.</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">diffent</button>
<button class="btn btn-danger">Quit</button>
</div>
</div>
我的目标是当我单击第二个模态按钮时,内容再次成为第二个模态中的内容,而不是第一个模态中的内容。我希望他们都不同。
使用 2 个不同的模态 ID。
<!-- Button to trigger modal -->
<a href="#myModal1" role="button" class="btn" data-toggle="modal">modal 1</a>
<!-- Modal -->
<div id="myModal1" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
...
<!-- Button to trigger modal -->
<a href="#myModal2" role="button" class="btn" data-toggle="modal">modal 2</a>
<!-- Modal -->
<div id="myModal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
...
引导演示:http://bootply.com/80525
相关文章:
- 使用javascript单击同一按钮,在两种样式之间更改css值
- 把两种不同的形式合为一
- 这两种不同的创建对象文字的方法有什么区别
- angularjs两种功能的替代品(欧芹和重置)
- 我想要相同的函数以两种方式反应
- HTML中两种JS实现之间的差异
- 比较两种不同格式的时间戳-GAS
- 这两种方法有什么不同
- 正则表达式,两种方式,不同的结果
- 如何将两种不同类型的事件附加到同一元素
- 这两种使用 jQuery 追加 DOM 元素的方法有什么不同
- 通过两种方法创建和更新 CSS
- 什么'这两种继承策略之间的区别是什么
- 使用jQuery过滤两种输入类型
- 如何在面板中添加在两种类型的谷歌图表之间切换的按钮
- 选择两种颜色并在两者之间选择n种颜色
- 如何在同一表单上拥有两种不同类型的日历
- 在两种功能之间进行选择的建议
- 如何在同一页面上的同一控制器上拥有两种不同的模态
- 我如何在Twitter引导中拥有两种不同的模态