欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Bootstrap模態(tài)框禁用空白處點(diǎn)擊關(guān)閉

 更新時(shí)間:2016年10月20日 16:01:31   作者:小壞  
這篇文章主要為大家詳細(xì)介紹了Bootstrap模態(tài)框禁用空白處點(diǎn)擊關(guān)閉的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

模態(tài)框(Modal)是覆蓋在父窗體上的子窗體。通常,目的是顯示來自一個(gè)單獨(dú)的源的內(nèi)容,可以在不離開父窗體的情況下有一些互動(dòng)。子窗體可提供信息、交互等。bootstrap的模態(tài)框在默認(rèn)情況下,點(diǎn)擊其他空白區(qū)域(通常是遮罩層),模態(tài)框會(huì)被關(guān)閉,那么以下方法就是禁止點(diǎn)擊其他區(qū)域關(guān)閉模態(tài)框。

$('#myModal').modal({backdrop: 'static', keyboard: false});

backdrop:static時(shí),空白處不關(guān)閉.

keyboard:false時(shí),esc鍵盤不關(guān)閉.

上述代碼也用于打開模態(tài)框。 

也可以使用以下方法:

<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
 <div class="modal-dialog custom-dialog succ-dialog">
 <div class="modal-content">
  <div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <h4>提示信息</h4>
  </div>
  <div class="modal-body">
  <div><img src="images/loading.gif"><p><span>投標(biāo)成功!</span><img src="images/success.png"></p></div>
  </div>  
 </div>
 </div>
</div>

這里的data-backdrop="static"指定一個(gè)靜態(tài)的背景,當(dāng)用戶點(diǎn)擊模態(tài)框外部時(shí)不會(huì)關(guān)閉模態(tài)框。而data-keyboard是指當(dāng)按下 escape 鍵時(shí)關(guān)閉模態(tài)框,設(shè)置為 false 時(shí)則按鍵無效。

如果大家還想深入學(xué)習(xí),可以點(diǎn)擊這里進(jìn)行學(xué)習(xí),再為大家附3個(gè)精彩的專題:

Bootstrap學(xué)習(xí)教程

Bootstrap實(shí)戰(zhàn)教程

Bootstrap插件使用教程

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論