8
rated 0 times
[
10]
[
2]
/ answers: 1 / hits: 28000
/ 14 Years ago, wed, february 9, 2011, 12:00:00
I have a JQuery plugin and I want to add some event to it.
Any help, tips, or tutorial?
More From » jquery
I have a JQuery plugin and I want to add some event to it.
Any help, tips, or tutorial?
As I understand correctly If you have some kind of button that close the popup and you need a function that is triggered after close.
(function($) {
$.fn.somePlugin = function(options) {
// do some stuff with popup
$('#closeButton').click(function(e) {
//close popup
if (options.onAfterClose !== undefined) {
options.onAfterClose(e);
}
});
};
})(jQuery);
it just pass the event from click event.
$('#someId').somePlugin({
onAfterClose: function(e) {
alert('after close');
}
});