Can I check if Bootstrap Modal Shown / Hidden?

前端 未结 11 1444
走了就别回头了
走了就别回头了 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 13:13

    For me this works

     
    if($("#myModal").css("display") !='none' && $("#myModal").css("visibility") != 'hidden')

    alert("modal shown");

提交回复
热议问题