Bootstrap 3 Modal: how to check if modal is open or closed using jquery/javascript

后端 未结 5 1089
陌清茗
陌清茗 2021-02-01 21:15

Can anyone please tell me how to check bootstrap 3.0 modal status, is it open or closed using jQuery or javascript. I used following code but it works when you have opened a mod

5条回答
  •  日久生厌
    2021-02-01 21:38

    if the modal is opened in a form loaded by ajax you can use

    $(document).on('hidden.bs.modal', '#photoModal', function () {
        cancel_camera();
        document.getElementById('PhotoPerson').innerHTML = '';
    });*
    

提交回复
热议问题