fancybox onClosed 回调不起作用

发布于 2025-01-05 00:02:42 字数 432 浏览 2 评论 0原文

我正在使用 fancyBox v2.0.4 ...

好吧,这应该很简单,但是在我的情况下不起作用...我只是想在 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
});

不起作用

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

美羊羊 2025-01-12 00:02:42

您正在使用旧版本中的选项,因此就像 -

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

您可以在 http://fancyapps.com/fancybox/# 找到这些选项文档

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

小傻瓜 2025-01-12 00:02:42
 $('a#stpa_announcement_details_open').fancybox({
   'afterClose': function() {
                               alert('test') 
                             }
  });

希望它有效..

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

Hope it works..

べ繥欢鉨o。 2025-01-12 00:02:42

使用 beforeClose 或 afterClose。在“回调”选项卡下查找 API 文档 http://fancyapps.com/fancybox/#docs

use beforeClose or afterClose. Find the API documentation under the Callbacks tab here http://fancyapps.com/fancybox/#docs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文