第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

多個(gè)模態(tài)疊加

多個(gè)模態(tài)疊加

多個(gè)模態(tài)疊加我需要疊加顯示在第一個(gè)模態(tài)上方,而不是在后面。$('#openBtn').click(function(){ $('#myModal').modal({show:true})});<a data-toggle="modal" href="#myModal" class="btn btn-primary">Launch modal</a><div class="modal" id="myModal"> <div class="modal-dialog">       <div class="modal-content">         <div class="modal-header">           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>           <h4 class="modal-title">Modal title</h4>         </div><div class="container"></div>         <div class="modal-body">           Content for the dialog / modal goes here.          <br>           <br>           <br>           <br>           <br>           <a data-toggle="modal" href="#myModal2" class="btn btn-primary">Launch modal</a>         </div>         <div class="modal-footer">           <a href="#" data-dismiss="modal" class="btn">Close</a>           <a href="#" class="btn btn-primary">Save changes</a>         </div>       </div>     </div></div><div class="modal" id="myModal2" data-backdrop="static"> <div class="modal-dialog">       <div class="modal-content">         <div class="modal-header">           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>           <h4 class="modal-title">Second Modal title</h4>         </div><div class="container"></div>         <div class="modal-body">           Content for the dialog / modal goes here.        </div>         <div class="modal-footer">           <a href="#" data-dismiss="modal" class="btn">Close</a>           <a href="#" class="btn btn-primary">Save changes</a>         </div>       </div>     </div></div><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/css/bootstrap.min.css" /><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.0/js/bootstrap.min.js"></script>我試圖改變z-index的.modal-backdrop,但它成了一個(gè)爛攤子。在某些情況下,我在同一頁面上有兩個(gè)以上的模態(tài)。
查看完整描述

3 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

我意識(shí)到答案已經(jīng)被接受,但我強(qiáng)烈建議不要黑客自舉來解決這個(gè)問題。

您可以通過掛鉤shown.bs.modal和hidden.bs.modal事件處理程序并在那里調(diào)整z-index來輕松實(shí)現(xiàn)相同的效果。

這是一個(gè)有效的例子

這里有更多信息。

此解決方案可自動(dòng)使用任意深度堆棧模式。

腳本源代碼:

$(document).ready(function() {

    $('.modal').on('hidden.bs.modal', function(event) {
        $(this).removeClass( 'fv-modal-stack' );
        $('body').data( 'fv_open_modals', $('body').data( 'fv_open_modals' ) - 1 );
    });

    $('.modal').on('shown.bs.modal', function (event) {
        // keep track of the number of open modals
        if ( typeof( $('body').data( 'fv_open_modals' ) ) == 'undefined' ) {
            $('body').data( 'fv_open_modals', 0 );
        }

        // if the z-index of this modal has been set, ignore.
        if ($(this).hasClass('fv-modal-stack')) {
            return;
        }

        $(this).addClass('fv-modal-stack');
        $('body').data('fv_open_modals', $('body').data('fv_open_modals' ) + 1 );
        $(this).css('z-index', 1040 + (10 * $('body').data('fv_open_modals' )));
        $('.modal-backdrop').not('.fv-modal-stack').css('z-index', 1039 + (10 * $('body').data('fv_open_modals')));
        $('.modal-backdrop').not('fv-modal-stack').addClass('fv-modal-stack'); 

    });        });


查看完整回答
反對(duì) 回復(fù) 2019-08-06
  • 3 回答
  • 0 關(guān)注
  • 522 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)