Monday, January 2, 2012

Lesson 1: jQuery animations are simultaneous

Hi folks! Inspired by jQuery tutorials on the web, I started porting some of them to CoffeeScript, which is, of course, a great source of fun too. I left coffeescript uncompiled so you could easier browse the page code.
Here goes a lesson from Wayfarer's animation tutorial, mostly unchanged.

All animations you start run simultaneously by default, unless you choose to stack them.



Animation in this example is very smooth, because the elements being animated are simple. Be careful, quality is likely to degrade for complex elements.

jQuery.animate function calls usual form:
jQuery(selector).animate( properties, [ duration ], [ easing ], [ callback ] ) with properties in [ brackets ] being optional. Using coffeescript you can drop some of the syntax if you like:

Source code links:

Ok, that was too simple, we surely want more fun. Get to the next lesson!

technorati token D6DWZM9N6BXZ  

2 comments :

  1. Thanks for putting this together, it is the best resource I have found on the subject.

    ReplyDelete