Bootstrap modal: close current, open new

前端 未结 27 1690
离开以前
离开以前 2020-11-29 00:23

I have looked for a while, but I can\'t find a solution for this. I want the following:

  • Open an URL inside a Bootstrap modal. I have this working off course. S
27条回答
  •  温柔的废话
    2020-11-29 01:00

    Problem with data-dismiss="modal" is it will shift your content to left

    I am sharing what worked for me, problem statment was opening pop1 from pop2

    JS CODE

    var showPopup2 = false;
    $('#popup1').on('hidden.bs.modal', function () {
        if (showPopup2) {
            $('#popup2').modal('show');
            showPopup2 = false;
        }
    });
    
    $("#popup2").click(function() {
        $('#popup1').modal('hide');
        showPopup2 = true;
    });
    

提交回复
热议问题