[jQuery] Re: How to Add A Callback Function to a plugin

2009-10-05 Thread MorningZ
I'd suggest looking @ Mike Alsup's BlockUI plugin http://www.malsup.com/jquery/block/jquery.blockUI.1.33.js follow along with happens with $.blockUI.impl.boxCallback On Oct 5, 4:10 pm, bittermonkey wrote: > How do I add a callback function to a plugin so that i can execute > another function a

[jQuery] Re: How to Add A Callback Function to a plugin

2009-10-05 Thread Jonathan Sharp
$.fn.myPlugin = function(options) {options $.extend({ callback: null }, options); // Your plugin if ( $.isFunction(options.callback) ) { options.callback.call(); } }; $('div').myPlugin({ callback: function() { // Your callback code } }); A better approach mig