how to check if fancybox exists on page already

后端 未结 5 1132
无人共我
无人共我 2021-02-09 01:43

I am trying to check if a fancybox has been loaded already. If so then I run an ajax script to put content inside.

If not I open a fancybox iframe and it fetches content

5条回答
  •  无人及你
    2021-02-09 02:37

    This works for me

    if ($('#fancy_content:empty').length > 0)
    {
        alert('Fancybox Open');
    }
    else
    {
        alert('Fancybox NOT Open');
    }
    

提交回复
热议问题