开发者

jQuery stacking events

开发者 https://www.devze.com 2023-02-25 01:41 出处:网络
So, i\'m using FancyBox plugin to have a database entry editor. I have a \"Save\" and a Cancel Button, that when clicked, after they do what i want, trigger the close button so i can see the animation

So, i'm using FancyBox plugin to have a database entry editor. I have a "Save" and a Cancel Button, that when clicked, after they do what i want, trigger the close button so i can see the animation, with: $('#fancybox-close').trigger('click');

Now, i'm trying to do the oposite: when the user clicks fancybox's close button, i wan to run some code before what is defined for it to do, something like:

$('#fanc开发者_开发百科ybox-close').click(function(){
   //my code here
   //#fancybox-close event here
})

how can i do this?

Thanks


According to the API page you can simply provide an onClosed handler when defining your FancyBox.

This function can then do whatever you'd like.

0

精彩评论

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