我的网页中有两个模态对话,使用 Twitter-bootstrap,但只有一个有效。
这是代码:
<a href="#format" role="button" class="btn btn-info" data-toggle="format">Phone and Email</a>
<div id="format" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="format" aria-hidden="true">
<div class="modal-header">
<!--This needs a fancy phone icon and so does the button.-->
<img src="img/numberheader.png" alt="">
</div>
<div class="modal-body">
<p>
<h4>Office:</h4>
123 4567<br>
<h4>Programme Manager:</h4>
765 4321<br>
<hr>
<img src="img/emailheader.png" alt="">
<h4>Email us</h4>Iremovedthemailaddresses<br>
<a href="Iremovedthemailaddresses" class="btn-primary btn-small">Click Here To Email Us</a>
<br>
</p>
</div>
<div class="modal-footer">
<button class="btn btn-info" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<a href="#myModal" role="button" class="btn btn-info" data-toggle="modal">Phone and Email</a>
<div id="myModal" class="modal hide fade" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<!--This needs a fancy phone icon and so does the button.-->
<img src="img/numberheader.png" alt="">
</div>
<div class="modal-body">
<p>
<h4>Office:</h4>
123 4567<br>
<h4>Programme Manager:</h4>
765 4321<br>
<hr>
<img src="img/emailheader.png" alt="">
<h4>Email us</h4>Iremovedthemailaddresses<br>
<a href="Iremovedthemailaddresses" class="btn-primary btn-small">Click Here To Email Us</a>
<br>
</p>
</div>
<div class="modal-footer">
<button class="btn btn-info" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
两个模态的内容还没有被分成它的意思,它只是在这一点上的概念证明(所以忽略内容)。
但是,它只适用于第二个,而不是第一个。我该怎么做才能使两种模式都起作用?