亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

bootstrap多層模態(tài)框滾動條消失的問題

 更新時間:2017年07月21日 09:58:04   作者:紅獅子座  
本篇文章主要介紹了bootstrap多層模態(tài)框滾動條消失的問題,具有一定的參考價值,有興趣的可以了解一下

bootstrap 打開多層模態(tài)框的情況下,關(guān)閉任意一個模態(tài)框,都會導(dǎo)致其余模態(tài)框的滾動條消失。

監(jiān)測html發(fā)現(xiàn),當(dāng)打開模態(tài)框時,會給 body 元素加一個 modal-open 的 class,而在 bootstrap.css 中,有這樣一條 css 規(guī)則:

.modal-open .modal {overflow-x:hidden; overflow-y:auto}

因為有 overflow-y:auto,所以模態(tài)框才可以滾動,而當(dāng)關(guān)閉任何一個模態(tài)框時,body 元素的 css 規(guī)則 modal-open 會被移除掉,自然 overflow-y:auto 也就沒有了,所以模態(tài)框的滾動條就消失了。

解決方案是在模態(tài)框的 div 元素上加一條 style="overflow: auto",如下:

<div class="modal fade" ... style="overflow: auto">

這樣,模態(tài)框的滾動就不依賴 body 元素的 css 規(guī)則 modal-open 了。

實例

<div class="modal fade" id="myModal2" data-backdrop="static" <span style="color:#ff0000;">style="overflow:scroll"</span> 
    popover-page-id="CS040104"> 
    <div class="modal-dialog modal-1200"> 
      <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">模態(tài)框(Modal)標(biāo)題222</h4> 
        </div> 
        <div class="modal-body" >在這里添加一些文本</div> 
        <div class="modal-footer"> 
          <button type="button" class="btn btn-success" 
                 data-toggle="modal" target="modal" 
      data-target="#myModal3">模態(tài)框</button> 
          <button type="button" class="btn btn-default" data-dismiss="modal">關(guān)閉</button> 
          <button type="button" class="btn btn-primary">提交更改</button> 
        </div> 
      </div> 
      <!-- /.modal-content --> 
    </div> 
    <!-- /.modal --> 
    </div> 

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

相關(guān)文章

最新評論