Fold Animations

Fold animations are used to change the widht and or height of an element over a specific time amount. There are 2 fold animations that can be used on elements included in AwesomeVisuals. Just reference an element and call one of the functions. Leaving the optional parameters false will assume certain defaults. Using Fold will collapse the element once it’s reached a width or height of 0.

$Div("myDiv").Fold();
// is the same as
$Div("myDiv").Fold(Direction.Vertical, Speed.Normal, Smoothness.Normal);
Fold(Direction direction, Number speed, Number frames, EventHandler onFinish) Folds up the element.
Unfold(Direction direction, Number speed, Number frames, EventHandler onFinish) Unfolds the element

Defaults and Enumerations

For speed and frames parameters, you can use the predefined enumerations Speed and Smoothness:

Speed.Slow

Speed.Normal

Speed.Fast

Speed.Faster

Speed.Fastest

Smoothness.Normal

Smoothness.Smooth

Smoothness.Smoother

Smoothness.Smoothest

The speed parameter indicates the amount of time the animation should take in milliseconds. A smaller value means a faster animation. The frames indicates the number of changes that will happen during the animations. Higher frames means a smoother animation, but too small of a number can cause slow downs and actually reverse the speed of animation.

 

Fold Directions

There are 3 different ways to fold or unfold an element using the Direction enumeration:

Direction.Vertical

Direction.Horizontal

Direction.Diagonal

Vertical will adjust only the height, horizontal will adjust the width and diagonal will adjust both during the animation.

Last edited Jun 12, 2011 at 7:26 PM by dahrkdaiz, version 2

Comments

No comments yet.