在我的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')
});
});
Run Code Online (Sandbox Code Playgroud)
尝试
$(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.");
}
});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3830 次 |
| 最近记录: |