disable fancybox after binding

I am having a strange issue, I have code that pulls content of wordpress posts that was using some plugin to bind fancybox to certain elements on the page. But now I want to implement that fancybox binding from some elements on that page.

I tried one solution for this that after binding fancybox, I removed the ‘fancybox’ class from the anchor tag. But removing class from the anchor tag in not working becoz dom collects all the elements before loading, even though i have removed the class that anchor is still being called in fancybox.

I can try with unbinding click event but I need the click event to work further with that.
Then I found a solution after some googling that if you include the attribute live:false then you will be able to remove the handlers from your elements using .off()

Means we need to set the fancybox attribut live:false and then remove the ‘click.fb-start’ handler from the element.By this way I can disable fancybox after binding.

If you are facing any issue regarding fancybox as well as colorbox then post us your query. We will try to provide you a solution as soon as possible.

You Might Interested In

Leave a Reply

Enclose a code block like: <pre><code>Your Code Snippet</code></pre>.