2012-02-12 81 views
6

我使用的fancybox V2.0.4 ...的fancybox onClosed回调不工作

嗯,这应该是简单的,但它并不在我的情况下工作...我只是想,当运行一个回调函数的fancybox关闭...

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

不起作用

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

不起作用

+0

http://meta.stackexchange.com/a/5235 – JFK 2012-10-24 17:21:34

回答

17

你是从旧版本使用的选项,因此它会像 -

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

您可以在http://fancyapps.com/fancybox/#docs

+0

你救了我的一天。布拉沃! – Ali 2012-04-05 08:36:06

+0

现场示例:http://jsfiddle.net/EWTxv/ – 2012-10-22 18:00:55

1
$('a#stpa_announcement_details_open').fancybox({ 
    'afterClose': function() { 
           alert('test') 
          } 
    }); 

希望工程..