Not quite, I don't necessarily want a delay in a set amount of time, I was looking to execute the second function after the first one has completed. For animations and AJAX calls, jQuery already handles that, but I wanted to integrate a callback functionality in my own custom methods.
Thanks for the help though! =) On Apr 11, 2:27 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote: > Jörn Zaefferer schrieb: > > > $.fn.delayHide(time, callbackArgument) { > > var self = this; > > setTimeout(function() { > > callbackArgument.call(self); > > }, time); > > } > > $("input").delay(3000, function() { > > this.hide(); > > }); > > > That should delay hiding an element by three seconds, using a callback. > > Does that example help? > > I think you wanted to write this: > > jQuery.fn.delay = function(time, callback) { > var self = this; > setTimeout(function() { > callback.call(self); > }, time); > > }; > > Nice! Where do useful micro plugins go? > > -- Klaus