FancyBox 2.0 afterClose event

fancybox, jquery

Solution

i found the answer myself, it should written like this

$.fancybox.open({
            href : '<?= site_url('sell_split/popup_qty/') ?>'+url_param,
            type : 'ajax',
            afterShow: popup_focus_qty,
            afterClose: function(){
                console.log('test')
            }                
        });

Problem

I have script fancybox like this ``` $.fancybox.open({ href : '<?= site_url('sell_split/popup_qty/') ?>'+url_param, type : 'ajax', afterShow: popup_focus_qty, afterClose: console.log('test') }); ``` As you can see, there is `afterClose` event. But it seems when i try this script the `afterClose` event is happened first and then `GET` process. This is not what i want. What i want to do is, the event `afterClose` is happening if the visitor closed FancyBox Window. Is this an error from FancyBox plugin or the my code is wrong?

Original source