3.3.5的bootstrap 是不是不支持在<form>里面增加模态框(modal)?
<body>
<form class="form-horizontal" role="form">
<button class="btn btn-primary btn-lg" data-toggle="modal"
data-target="#myModal"> 开始演示模态框 </button>
</form>
<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" id="myModalLabel"> 模态框(Modal)标题 </h4>
</div>
<div class="modal-body"> 在这里添加一些文本 </div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">关闭 </button>
<button type="button" class="btn btn-primary"> 提交更改 </button>
</div>
</div>
</div>
</div>
</body>
<form class="form-horizontal" role="form">
<button class="btn btn-primary btn-lg" data-toggle="modal"
data-target="#myModal"> 开始演示模态框 </button>
</form>
<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" id="myModalLabel"> 模态框(Modal)标题 </h4>
</div>
<div class="modal-body"> 在这里添加一些文本 </div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">关闭 </button>
<button type="button" class="btn btn-primary"> 提交更改 </button>
</div>
</div>
</div>
</div>
</body>
0 个回复