how to destroy bootstrap modal window completely?

后端 未结 24 908
旧时难觅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:15

    From what i understand, you don't wanna remove it, nor hide it ? Because you might wanna reuse it later ..but don't want it to have the old content if ever you open it up again ?

    
    

    If you wanna use it as a dynamic template just do something like

    $(selector).modal({show: true})
    
    ....
    
    $(selector).modal({show: false})
    $(".modal-body").empty()
    
    ....
    
    $(".modal-body").append("new stuff & text")
    $(selector).modal({show: true})
    

提交回复
热议问题