Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FancyBox 2.0 afterClose event

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.

enter image description here

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?

like image 662
GusDeCooL Avatar asked Jun 15 '12 03:06

GusDeCooL


1 Answers

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')
            }                
        });
like image 107
GusDeCooL Avatar answered Sep 27 '22 17:09

GusDeCooL