Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fancybox onClosed callback does not work

I am using fancyBox v2.0.4 ...

Well this should be simple, however it does not work in my case... I simply want to run a callback function when the fancybox is closed...

$('a#stpa_announcement_details_open').fancybox({
    'onCleanup': function() { alert('test') },
    'hideOnContentClick': true
});

does not work

$('a#stpa_announcement_details_open').fancybox({
    'onClosed': function() { alert('test') },
    'hideOnContentClick': true
});

does not work

like image 612
Andreas Avatar asked Feb 12 '12 16:02

Andreas


1 Answers

You are using options from older versions, so it would be like -

$('a#stpa_announcement_details_open').fancybox({
    'beforeClose': function() { alert('test') },
    'closeClick': true
});

You can find these options at http://fancyapps.com/fancybox/#docs

like image 168
Janis Avatar answered Sep 20 '22 13:09

Janis