我有一个页面,我想打开多个模式。我能够让id="myModal“的模式出现,这就是我试图复制的例子。我创建了第二个带有id=“红地毯”的窗口,我无法获得相同的窗口弹出。我希望有人能在我的代码中看到一个错误,并能帮助我修复它。
<li class="dropdown">
<a href="#" class="dropdown-toggle dropdown" data-toggle="dropdown" data-hover="dropdown"
data-delay="200" data-close-others="false"><span style="color: black; font-family: 'Modern Regular';">PHOTOS</span></a>
<ul class="dropdown-menu">
<li>
<a href="#redcarpet">Red Carpet</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#myModal"><span style="color: black; font-family: 'Modern Regular';">LEAD</span></a>
</li> × 2015 Awards <!-- red carpet Modal -->
<!-- Modal -->
<div class="modal modal-wide fade" id="redcarpet" tabindex="-1" role="dialog"
aria-labelledby="redcarpetLabel" 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" id="redcarpetLabel">2015 Awards</h4>
</div>
<div class="modal-body">
<iframe src="redCarpet.html" width="580" height="780" frameborder="0"
allowtransparency="true"></iframe>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
<!-- /.modal -->
<!-- Modal -->
<div class="modal modal-wide 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" id="myModalLabel">2015 Billboard Music Awards</h4>
</div>
<div class="modal-body">
<iframe src="billboardmusicawards_lead.htm" width="580" height="780" frameborder="0"
allowtransparency="true"></iframe>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
<!-- /.modal -->发布于 2015-04-09 20:08:21
您说您已经将modal容器的id更改为redcarpet (是的,可以在代码中看到)。
但是,在调用此模式的链接的data-target属性中,仍然使用旧id (#myModal):
<a href="#" data-toggle="modal" data-target="#myModal">https://stackoverflow.com/questions/29553448
复制相似问题