How do I close a modal window after AJAX success

前端 未结 6 1038
梦如初夏
梦如初夏 2020-12-17 14:19

I have a button which opens a modal but I have prevented the modal close by clicking background or ESC key.

My button looks like this:

6条回答
  •  盖世英雄少女心
    2020-12-17 15:10

    success :function(){
                  console.log("success");
                  $('#contact_modal').html("").delay(3000).fadeOut(450);
                  $('body').removeClass('modal-open');
                  $('.modal-backdrop.show').css('opacity','0');
                  $('.modal-backdrop').css('z-index','-1')
              }
    

提交回复
热议问题