[jQuery] Is there a simple way?
(I'm not sure this got though so excuse me if I am sending it a second time)
Klaus this is FANTASTIC. Its way way way better than settimeout because the
chained list of events is to easy to understand.
I think your example at learningjquery is really neat but it's a little
obscured by the other neat trick of insert HTML right after a click via
insertion. That in itself deserves its own page but the use of animate as a
delay timer is really awesome. I could not understand the example before I
knew jQuery, but now I can.
The key is: animate({ opacity: 1 }, 2000). Which does nothing other change
the opacity of the element its attached to for 2 seconds. The real key for
me was that the effects could be queued.
I knew that if you set things up this way they all happened at the same
time.
$('#spinner').fadeIn('fast')
$('#spinner').animate({ opacity: 1 }, 2000)
$('#spinner').fadeOut('fast')
But did not know chainging them executes them sequentially. That is great to
know and makes things so much easier.
Thanks so much for:
$('#spinner').fadeIn('fast').animate({ opacity: 1 }, 2000).fadeOut('fast');
Mitch
-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On
Behalf Of Klaus Hartl
Sent: Tuesday, July 31, 2007 10:45 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Is there a simple way?
We can use a little trick here (animations are queued):
$('#spinner').fadeIn('fast').animate({ opacity: 1 }, 2000).fadeOut('fast');
Untested.
Technique first seen here:
http://www.learningjquery.com/2007/01/effect-delay-trick
--Klaus