Bootstrap modal hide is not working

后端 未结 20 1323
温柔的废话
温柔的废话 2020-12-09 08:11

Bootstrap modal hide is not working. Alert comes in else. but my modal is not hidden Added bootply. My issue is the same one.

20条回答
  •  攒了一身酷
    2020-12-09 08:53

    I am also having the same problem, where I can't find the correct solution for it.

    Later I observed that what is happening when the modal gets closed when it works well.

    Three Main properties are,

    • modal-open class gets removed from tag.
    • In tag change CSS .
    • class of modal-backdrop gets removed.

    So, When u do these things manually, you will achieve it, when not works.

    The code should be as following in Jquery,

          $('body').removeClass('modal-open');        
          $('body').css('padding-right', '');
          $(".modal-backdrop").remove();
          $('#myModal').hide();
    

    Hence, try this and get a solution.

提交回复
热议问题