Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to destroy Fancybox?

I'm trying to destroy Fancybox. I haven't found any method to do it in documentation. How to destroy it after it was initialized?

This doesn't work:

$("a").unbind('fancybox').unbind('click');

Testing code: http://jsfiddle.net/martinba/yy3cw/2/

I use current version 2.1.4.

like image 226
Martin Ille Avatar asked Mar 01 '13 09:03

Martin Ille


1 Answers

In order to unbind fancybox you have to unbind events under fb-start namespace from document:

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

Though, I don't know why developer made it so unobvious.

http://jsfiddle.net/dfsq/yy3cw/16/

like image 99
dfsq Avatar answered Oct 21 '22 13:10

dfsq