天天操天天操-欧美黄视频-亚洲午夜激情-黄色网址免费-少妇精品无码一区二区三区-欧美成人免费在线视频-国产毛片一区二区三区-欧美一区二区三区婷婷月色-四虎影视库-日本在线高清-毛片999-天天操欧美-国产午夜伦理-手机福利在线-视频在线91-免费在线观看亚洲-好爽快一点高潮了-国产污视频在线-成 人片 黄 色 大 片-激情久久网站-丰满少妇xxxx-女教师在办公室被躁在线播放-亚洲高清色-视色视频在线观看-婷婷色5月-又粗又硬又黄又爽的视频-好大好湿好硬顶到了好爽视频-中国美女黄色-国产精品刮毛-国内三级在线观看

bootstrap中模態框、模態框的屬性

2017/2/24 8:32:36   閱讀:3087    發布者:3087

工作中有需要用到模態框的可以看看

<div class="modal fade" id="userModal" tabindex="-1" 
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
data-backdrop="static" data-keyboard="false"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"
aria-hidden="true" id="btnCancel"> &times; </button> <h4 class="modal-title" id="myModalLabel"> 前臺菜單管理 </h4> </div> <div class="modal-body"> <div> <table width="100%" border="0" class="userCon_2"> <tr> <th width="30%">名稱:</th> <td width="70%"> <input type="text" name="Name" class="form-control"
style="border-radius:3px; width:220px;"
id="txtName" required="" aria-required="true"> </td> </tr> <tr> <th>動作類型:</th> <td> <select class="selectpicker show-tick"
id="txtType" style="height: 30px; width: 220px;" name="Type"> <option value="view">view</option> <option value="click">click</option> </select> </td> </tr> <tr> <th>路徑:</th> <td> <input type="text" name="Url" class="form-control"
style="border-radius:3px; width:220px;"
id="txtUrl" required="" aria-required="true" /> </td> </tr> <tr> <th>排序:</th> <td> <input type="text" name="Rank" class="form-control"
style="border-radius:3px; width:220px;" id="txtRank" /> <input type="hidden" name="MainMenuGuid" value=""
id="txtMainMenuGuid" /> </td> </tr> </table> </div> </div> <div class="modal-footer" style="border-top:none;"> <button type="button" class="btn btn-default"
data-dismiss="modal" id="btnClose">關閉</button> <button type="submit" class="btn btn-primary"
id="btnSave">保存</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal --> </div>

 

其中模態框有個屬性可以避免點擊遮罩層導致模態框關閉。就是div中設置的 
data-backdrop="static"。這樣可以避免在模態框中輸入內容時突然的
誤操作導致模態框關閉。

另外還有一個屬性:data-keyboard="false"。此舉是設置按下ESC退出鍵無效。
同樣是為了避免突然的誤操作導致模態框關閉。

 

<div id="toolbar" class="btn-group"> 
            <button id="btn_add" type="button" class="btn btn-newAdd" 
data-toggle="modal" data-target="#userModal"> <span class="glyphicon glyphicon-plus"
aria-hidden="true"></span>新增 </button> <button id="btn_edit" type="button" class="btn btn-newAdd"> <span class="glyphicon glyphicon-edit"
aria-hidden="true"></span>修改 </button> <button id="btn_delete" type="button" class="btn btn-newAdd"> <span class="glyphicon glyphicon-remove"
aria-hidden="true"></span>刪除 </button> </div>

其中按鈕屬性 data-toggle="modal" data-target="#userModal" 是打開模態框。