how to destroy bootstrap modal window completely?

后端 未结 24 911
旧时难觅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 19:16

    I had a same scenario where I would open a new modal on a button click. Once done, I want to completely remove it from my page... I use remove to delete the modal.. On button click I would check if modal exists , and if true I would destroy it and create a new modal ..

    $("#wizard").click(function() {
        /* find if wizard is already open */
        if($('.wizard-modal').length) {
            $('.wizard-modal').remove();
        }
    });
    

提交回复
热议问题