Bootstrap modal: close current, open new

前端 未结 27 1710
离开以前
离开以前 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 00:55

    By using the following code you can hide first modal and immediately open second modal, by using same strategy you can hide second modal and show the first one.

    $("#buttonId").on("click", function(){
        $("#currentModalId").modal("hide");
        $("#currentModalId").on("hidden.bs.modal",function(){
        $("#newModalId").modal("show");
        });
    });
    

提交回复
热议问题