国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

bootstrap中模態(tài)框、模態(tài)框的屬性實(shí)例詳解

2019-11-19 17:31:58
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

工作中有需要用到模態(tài)框的可以看看

<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">            ×          </button>          <h4 class="modal-title" id="myModalLabel">            前臺(tái)菜單管理          </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>動(dòng)作類型:</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">關(guān)閉</button>            <button type="submit" class="btn btn-primary" id="btnSave">保存</button>          </div>      </div><!-- /.modal-content -->    </div><!-- /.modal -->  </div>

其中模態(tài)框有個(gè)屬性可以避免點(diǎn)擊遮罩層導(dǎo)致模態(tài)框關(guān)閉。就是div中設(shè)置的 data-backdrop="static"。這樣可以避免在模態(tài)框中輸入內(nèi)容時(shí)突然的誤操作導(dǎo)致模態(tài)框關(guān)閉。

另外還有一個(gè)屬性:data-keyboard="false"。此舉是設(shè)置按下ESC退出鍵無(wú)效。同樣是為了避免突然的誤操作導(dǎo)致模態(tài)框關(guān)閉。

<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" 是打開(kāi)模態(tài)框。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 鹰潭市| 遂平县| 吉林市| 司法| 晋江市| 东山县| 乌拉特中旗| 攀枝花市| 抚顺县| 延吉市| 高尔夫| 垣曲县| 竹山县| 舞钢市| 阜康市| 客服| 乐亭县| 鄂托克前旗| 长沙市| 青阳县| 张家川| 平邑县| 和静县| 遂川县| 本溪| 哈尔滨市| 铁岭县| 娱乐| 靖边县| 乃东县| 同德县| 西吉县| 拉孜县| 勐海县| 汝阳县| 乌鲁木齐县| 梁河县| 乌兰察布市| 云龙县| 赤水市| 丽江市|