Home > Ajax > dcomments.blogs.d.dojo_toolkit_blogs  [ Add to favorite]  Print Message

Disintegrate Effect


With the successful completion of the explode effect, I decided to build on the code used to split the node into pieces. I split the code in half and thus created a new generic function, dojox.fx._split that returns an animation object that splits the node into args.rows and args.columns and applies args.pieceAnimation() to each piece. This function takes the piece, its x and y location in the grid of pieces, and the dojo.coords of the original node as arguments and returns either an animation object or an array of animation objects to be combined.

So, I can now start churning out all types of effects that deal with pieces of a node separately. I've already created a disintegrate effect, in which each piece drops 1.5 times the height of the node and fades out. You can play with it and other effects in progress here.

Although I could continue in this direction, I've decided to go back and create effects that make the node appear from nothing rather than disappear. This may be slightly more involved, since I'd like to avoid the "stale values" issue as well as making the user explicitly define the dimensions of the node at the end of the animation.

Sat,
05 Jul 2008
Original article here