[jQuery] Re: Ultra simple question: Plugin callback

2008-10-04 Thread Micky Hulse
Yikes, I forgot about: $().ajaxSend(function(evt, request, settings){ $loader.fadeIn(fadeSpeed); }); $().ajaxStop(function(evt, request, settings){ $loader.fadeOut(fadeSpeed); }); Handling the loading image via the jQform options/callbacks was the majority of my problem... I coul

[jQuery] Re: Ultra simple question: Plugin callback

2008-10-04 Thread Micky Hulse
Hi Mike! Many many thanks for your detailed reply -- I really appreciate the help. :) Sorry about the lack of indentation... Thanks for taking the time to re-format my code. I was not sure if Google Groups would break the long lines, so I removed the tabs. :( Thanks for pointing-out the problem

[jQuery] Re: Ultra simple question: Plugin callback

2008-10-04 Thread Micky Hulse
Ah, this is better: $.fn.toggleAnim1 = function(fn){ var $obj = this; $obj.each(function(){ $obj.animate({'opacity': 'toggle', 'height': 'toggle'}, 'slow', function () { $.isFunction(fn) && fn(); }); }); }; Obviously, I am kinda a plugin noob... Feel free to give tips! :) Just ordered jQuery R

[jQuery] Re: Ultra simple question: Plugin callback

2008-10-04 Thread Michael Geary
Looks like you solved it yourself; your second version is much closer to the mark. Do you actually write your code unindented like that, though, or did the indentation just lost in the process of posting it? I would format your code more like this: $.fn.toggleAnim1 = function(fn){ va