Book Image

Meteor Cookbook

By : Isaac Strack
Book Image

Meteor Cookbook

By: Isaac Strack

Overview of this book

Table of Contents (19 chapters)
Meteor Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Animating DOM elements


Meteor has a very elegant way of rendering DOM elements in our web apps, but until now, this hasn't included animations. Fortunately for us, Meteor now supports animations, including animations when an element is first added to the DOM. This recipe will walk you through how to use standard CSS animation techniques inside Meteor.

Getting ready

We will use the codebase from the Using dynamic templates recipe found in this chapter. Please follow that recipe first or download the corresponding codebase.

How to do it...

We will animate the shapes from our previous recipe, demonstrating animation both before and after the elements are first created and rendered.

Because we used SVG elements instead of DOM elements, we need to modify jQuery to be able to use .addClass and .removeClass. Fortunately, there is a custom package available that will add SVG support and add Meteor UI event support at the same time.

  1. In a terminal window, navigate to the root folder of your project and...