On 21/02/2012 14:55, hamburger wrote:
Thanks Arian,
I did not remember the event load in this case.
I think its running. Not nice but ...
http://jsfiddle.net/4YsUV/6/
are the errors jsfiddle ones?
Why the the delay funktion not as easy as the jquery one?
moo: (function () {$("preloader").fade('out');}).delay(5000);
jquery: $("#preloader").delay(5000).fadeOut();
It can be simple-ish:
basically, delay is a function decorator, you tell it to run the method
fade from whatever:
var pre = $("preloader");
// from host obj a fade.
Element.fade(pre, [0,1]);
// delayed from host obj - first arg is element, second is for fade
Element.fade.delay(1000, null, [pre, [0,1]]);
// from prototype, bind, simpler - bind to object, pass arg
Element.prototype.fade.delay(2000, pre, [0,1]);
// kind of the same as above
pre.fade.delay(3000, pre, [0,1]);
the jquery one will basically make a function out of $(this).fadeOut()
and run it after 500ms, so it's kind of written backwards but the end
result is the same as your initial mootools one.
--
Dimitar Christoff
"JavaScript is to JAVA what hamster is to ham"
Personal blog: http://fragged.org/ - Twitter: @D_mitar