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

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

關(guān)閉另一個(gè)模式時(shí)打開模式的問題

關(guān)閉另一個(gè)模式時(shí)打開模式的問題

一只斗牛犬 2023-05-25 18:19:48
這是我的場(chǎng)景。我有一個(gè)模式(模式 A),在頁腳中有 2 個(gè)按鈕:保存并關(guān)閉。當(dāng)我點(diǎn)擊“保存”按鈕時(shí),我需要關(guān)閉模態(tài) A 并打開模態(tài) B,它適用于以下代碼:模態(tài)A:<div class="modal fade" tabindex="-1" role="dialog" id="modalAddressees">    <div class="modal-dialog modal-lg" role="document">        <div class="modal-content">            <div class="modal-header">                <h5 class="modal-title">Select Addresses</h5>                <button type="button" class="close" data-dismiss="modal" aria-label="Close">                    <span aria-hidden="true">×</span>                </button>            </div>            <div class="modal-body">                [....]            </div>            <div class="modal-footer bg-whitesmoke br">                <button type="button" id="saveBtn" class="btn btn-primary">Save</button>                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>            </div>        </div>    </div></div>Java腳本:$().ready(function () {    $("#saveBtn").on('click', function () {        $('#modalAddressees').modal('hide')        $('#modalAddressees').on('hidden.bs.modal', function () {            $('#modalNewAddress').modal('show');        })    });});但是在我關(guān)閉模態(tài) B 并再次打開模態(tài) A 之后,如果我單擊關(guān)閉按鈕(關(guān)閉它)它會(huì)再次打開模態(tài) B,為什么?在我的 Javascript 中,我選擇僅在單擊“保存”按鈕時(shí)打開模式 B,而不是關(guān)閉按鈕。請(qǐng)問你能幫幫我嗎?這里我的測(cè)試有同樣的錯(cuò)誤:https ://jsfiddle.net/swim89/xso0jw9k/2/
查看完整描述

3 回答

?
慕蓋茨4494581

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

為了解決這個(gè)問題,我改變了我的代碼是這樣的:


$().ready(function () {

    $("#saveBtn").on('click', function () {

        $('#modalAddressees').modal('hide');

        $('#modalNewAddress').modal('show');

    });

});


查看完整回答
反對(duì) 回復(fù) 2023-05-25
?
烙印99

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

在隱藏的 bs 模態(tài) id: modalAddAddress 顯示模態(tài) id: modalNewAddress


$('#modalAddressees').on('hidden.bs.modal', function () {

    $('#modalNewAddress').modal('show');

 })

似乎它像你寫的那樣工作。


查看完整回答
反對(duì) 回復(fù) 2023-05-25
?
心有法竹

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

Javascript

$().ready(function () {

    const modalA = $('#modalAddressees');

    $("#saveBtn").on('click', function () {

        modalA.modal('hide')

        modalA.off('hidden.bs.modal').on('hidden.bs.modal', function () {

            modalA.modal('show');

        })

    });

});

或者


$().ready(function () {

    const modalA = $('#modalAddressees');

    modalA.on('hidden.bs.modal', function () {

        modalA.modal('show');

    });

    $("#saveBtn").on('click', function () {

        modalA.modal('hide');

    });

});


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

添加回答

舉報(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)