-
Recent Posts
Tags
app engines attributes cgi database DBI Debian frameworks full screen terminal GWT hacks hardware hobbit howto html inheritance javascript jQuery libraries Linux mac oracle OSX parallels Perl photoshop pixels PostgreSQL programming qa regression testing screen size Software Development style template toolkit term Theory translation type cast User Interface virtual machine virtual machines visual studio vmware web design web programming
Chaining JQuery Show/Hide Using Callbacks
JQuery provides the capacity to do animated showing and hiding of elements through the show(speed, callback) and hide(speed, callback) functions. As you can see, these two functions take an optional speed parameter, and an optional callback. Speed specifies how slowly the animation is performed, while callback specifies a function to call when the animation is done. Below, we will use the callback to chain animations together.
Here’s the example
Here’s the code.. the nested callbacks get a little hairy, but it’s functional and devoid of confusing abstraction.