Fade Animations

Fade animations are used to change the opacity of an element over a specific time amount. There are 3 fade 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 FadeOut will collapse the element once it’s reached a opacity of 0.

$Div("myDiv").FadeOut();
// is the same as
$Div("myDiv").FadeOut(Speed.Normal, Smoothness.Normal);
FadeIn(Number speed, Number frames, EventHandler onFinish) Fades the element into view.
FadeOut(Number speed, Number frames, EventHandler onFinish) Fades the element out of view.
FadeTo(Number opacity, Number speed, Number frames, EventHandler onFinish) Fades the element to the specified opacity.

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.

Last edited Jun 12, 2011 at 8:09 PM by dahrkdaiz, version 1

Comments

No comments yet.