模態(tài)彈出框--模態(tài)彈出窗的使用(data-參數(shù)說明)
除了通過data-toggle和data-target來控制模態(tài)彈出窗之外,Bootstrap框架針對模態(tài)彈出框還提供了其他自定義data-屬性,來控制模態(tài)彈出窗。比如說:是否有灰色背景modal-backdrop,是否可以按ESC鍵關(guān)閉模態(tài)彈出窗。有關(guān)于Modal彈出窗自定義屬性相關(guān)說明如下所示:

(單擊可放大)
任務(wù)
我來試試:在右側(cè)代碼編輯器中嘗試一下本節(jié)新學(xué)的屬性。
data-backdrop="static"
data-keyboard="false"
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>模態(tài)彈出窗的使用</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<!-- data-target觸發(fā)模態(tài)彈出窗元素 -->
<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal-data" type="button">通過data-target觸發(fā)</button>
<!-- 模態(tài)彈出窗內(nèi)容 -->
<div class="modal fade" id="mymodal-data" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">模態(tài)彈出窗標(biāo)題</h4>
</div>
<div class="modal-body">
<p>模態(tài)彈出窗主體內(nèi)容</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">關(guān)閉</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>
請驗證,完成請求
由于請求次數(shù)過多,請先驗證,完成再次請求