在我的 Fancybox 完全关闭且页面恢复正常后,我尝试触发第二个 jquery 函数。我尝试使用 onClosed fancybox 属性,但它不是在框关闭后发生,而是在框打开之前发生(在页面加载时,因为我将 fancybox 设置为在页面加载时打开)。我错过了什么?
$(document).ready(function () {
$("a#splash").trigger('click');
$("a#splash").fancybox({
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'type': 'inline',
'hideOnContentClick': true,
'overlayOpacity': 1,
'onClosed': alert('testing')
});
});
最佳答案
尝试
$(function(){
$("a#splash").trigger("click");
$("a#splash").fancybox({
"autoScale": false,
"transitionIn": "none",
"transitionOut": "none",
"type": "inline",
"hideOnContentClick": true,
"overlayOpacity": 1,
"onClosed": function(){
alert("Testing! FancyBox closed.");
}
});
});
关于jquery - Fancybox onClosed 函数在盒子打开之前发生?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5332516/