how to destroy bootstrap modal window completely?

后端 未结 24 858
旧时难觅i
旧时难觅i 2020-11-29 18:51

I\'ve made use of modal window for a wizard implementation which has around 4,5 steps. I need to destroy it completely after the last step(

24条回答
  •  一生所求
    2020-11-29 18:59

    I have to destroy the modal right after it is closed through a button click, and so I came up with the following.

    $("#closeModal").click(function() {
        $("#modal").modal('hide').on('hidden.bs.modal', function () {
            $("#modal").remove();
        });
    });
    

    Note that this works with Bootstrap 3.

提交回复
热议问题