jQuery stacking events
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.
精彩评论