new 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_targetObject Target object being animated.
p_propertyString Property to animate.
p_valueObject Final value of the property.
p_durationNumber nullable Duration in seconds. Defaults to
Reel.defaultDuration.p_delayNumber nullable Delay before animation. Defaults to
0.0.p_easingEasing nullable Animation easing. Defaults to
Reel.defaultEasing.p_run_on_backgroundBoolean 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_targetObject Target object being animated.
p_propertyString nullable Property name to match. Defaults to
""(stop all).p_ignore_listArray.<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'