Capture close event on Bootstrap Modal

后端 未结 6 2017
轮回少年
轮回少年 2021-02-01 11:52

I have a Bootstrap Modal to select events. If the user clicks on the X button or outside the modal, I would like to send them to the default event. How can I capture these event

6条回答
  •  爱一瞬间的悲伤
    2021-02-01 12:35

    Alternative way to check would be:

    if (!$('#myModal').is(':visible')) {
        // if modal is not shown/visible then do something
    }
    

提交回复
热议问题