Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
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

 Answers
9

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');
}
});

[#93821] Monday, February 7, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ellisw

Total Points: 625
Total Questions: 92
Total Answers: 88

Location: Kazakhstan
Member since Mon, Sep 26, 2022
2 Years ago
ellisw questions
Mon, Aug 23, 21, 00:00, 3 Years ago
Fri, Nov 20, 20, 00:00, 4 Years ago
Sat, Jun 20, 20, 00:00, 4 Years ago
Tue, Apr 21, 20, 00:00, 4 Years ago
;