Bootstrap modal hide is not working

后端 未结 20 1450
温柔的废话
温柔的废话 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:39

    Before you open a loading modal, make sure that you close all others. This is the function is use to close the modal:

    function hideLoadingModal() {
        $('#loadingModal').on('shown.bs.modal', function () {
            $('#loadingModal').modal('hide');      
        }); 
    }
    

    Now if I want to open the modal I call the above function and open a new one after that. Like this:

    hideLoadingModal();
    $('#loadingModal').modal('show');
    

    Hope this helps you.

    Cheers

提交回复
热议问题