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

Reply via email to