Unbind/Destroy fancybox 2 events

前端 未结 4 1922
孤城傲影
孤城傲影 2021-01-12 11:49

I am having a strange issue, I have code that pulls content via ajax and then binds Fancybox (2) to certain elements. The issue is that when I \"refresh\" this page I call t

4条回答
  •  盖世英雄少女心
    2021-01-12 12:35

    I know this is an old thread, but just wanted to confirm OAC Designs is absolutely right: Unbinding the .fancybox links only works if the live parameter is set to false.

    However, you can also destroy Fancybox at the dom level, regardless of the live parameter, by doing:

    $(document).unbind("click.fb-start");

    Or

    $(document).off("click.fb-start");


    JSFiddle

    Check out this JSFiddle for reference.

提交回复
热议问题