Class: Reel

Reel

Class that implements the animation/tweening features of SuitJS.

Members

staticReel.defaultDurationNumber

Default duration in seconds when none is specified. Defaults to '0.3' seconds.

staticReel.defaultEasingEasing

Default easing when none is specified. Defaults to 'Linear'.

staticReel.listArray.<ReelAnimation>

List of active animations.

Methods

staticReel.add(p_target, p_property, p_value, p_duration, p_delay, p_easing, p_run_on_background){ReelAnimation}

Adds an Animation to the execution loop.

Name Type Description
p_target Object

Target object being animated.

p_property String

Property to animate.

p_value Object

Final value of the property.

p_duration Number nullable

Duration in seconds. Defaults to Reel.defaultDuration.

p_delay Number nullable

Delay before animation. Defaults to 0.0.

p_easing Easing nullable

Animation easing. Defaults to Reel.defaultEasing.

p_run_on_background Boolean nullable

Flag that indicates the loop will keep running when the tab isn't focused.

Returns:
Type Description
ReelAnimation
  • Reference to the animation node created.
Example

var b = document.body;
b.style.backgroundColor = "#fff";
//Will animate with defaultEasing the 'body' background color during 3s but waiting 1s to start.
Reel.add(b.style,"backgroundColor","#f00",3.0,1.0,Cubic.out);

staticReel.stop(p_target, p_property, p_ignore_list)

Remove Animations that matches the specified criteria.

Name Type Description
p_target Object

Target object being animated.

p_property String nullable

Property name to match. Defaults to "" (stop all).

p_ignore_list Array.<ReelAnimation> nullable

List of animation nodes that must be ignored in the query.

Example

var b = document.body;
//Starts animations.
Reel.add(b.style,"backgroundColor","#f00",3.0);
Reel.add(b.style,"width","50px",3.0);

Reel.stop(b,"width"); //Stops only the 'width' animation
Reel.stop(b); //Stops all animations for 'b'

comments powered by Disqus