开发者

Fancybox onClosed function happening before box opens?

I am trying to fire a s开发者_StackOverflow中文版econd jquery function after my Fancybox is completely closed and the page is back to normal. I tried using the onClosed fancybox attribute, but instead of happening after the box is closed, it's happening before the box opens (on page load, because I have fancybox set to open on page load). What am I missing?

$(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')
 });
});


Try

$(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.");
        }
    });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜