Can I check if Bootstrap Modal Shown / Hidden?

前端 未结 11 1451
走了就别回头了
走了就别回头了 2020-12-05 12:29

Can I check if Bootstrap Modal currently Shown / Hidden Programatically?

Like bool a = if(\"#myModal\").shown(); ?

I need true/false

11条回答
  •  眼角桃花
    2020-12-05 12:58

    When modal hide? we check like this :

    $('.yourmodal').on('hidden.bs.modal', function () {
        // do something here
    })
    

提交回复
热议问题