[jQuery] Chainable effects

[jQuery] Chainable effects

Methods such as fadeOut() return immediately, after setting a timer which
actually does the effect. They do take a second argument, a function which
is called after the effect finishes. (I think it can also be an object of
some sort, but a function will work.)
So, you can do this:
$(element).fadeOut('slow', function() {
$(this).html(myString).fadeIn('slow');
});
For a related discussion, see this page:
http://jquery.com/discuss/2006-April/
and follow the links titled "A delay method?"
-Mike










    • Topic Participants

    • mike