是否可以通过单击模态窗体中的href来替换另一个模态窗体?
由于
答案 0 :(得分:1)
请试一试。
HTML
<a href="#" id="launchModel1">Launch modal 1</a>
<div id="modal1" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel1" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
Modal 1
<a href="#" id="launchModel2">Launch modal 2</a>
</div>
</div>
</div>
<div id="modal2" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
Modal 2
</div>
</div>
</div>
的Javascript
$("#launchModel1").bind("click", function(){
$('#modal1').modal('show');
});
$("#launchModel2").bind("click", function(){
$('#modal1').modal('hide');
$('#modal2').modal('show');
});