12.8. Chaining Events

The real power of jQuery comes from its capability to chain functions together. Imagine that you want to fade your <div> in and out a number of times. You can easily accomplish this procedure with the following code:

$("#div1").fadeOut().fadeIn().fadeOut().fadeIn().fadeOut();

Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.