Experimental and extended Animations beyond Dojo Core / Base functionality. Provides advanced Lines, Animations, and convenience aliases.
See the dojox/fx/flip reference documentation for more information.
a custom _Line to accommodate multi-dimensional values
a normal dojo._Line is the curve, and does Line(start,end) for propertyAnimation. as we make more complicatied animations, we realize some properties can have 2, or 4 values relevant (x,y) or (t,l,r,b) for example
this function provides support for those Lines, and is ported directly from 0.4 this is a lot of extra code for something so seldom used, so we'll put it here as and optional core addition. you can create a new line, and use it during onAnimate as you see fit.
Parameter | Type | Description |
---|---|---|
start | Integer | Array | An Integer (or an Array of integers) to use as a starting point |
end | Integer | Array | An Integer (or an Array of integers) to use as an ending point |
see dojox.fx.smoothScroll
// this is 10 .. 100 and 50 .. 500 var curve = new dojox.fx._Line([10,50],[100,500]); // dojo.Animation.onAnimate is called at every step of the animation // to define current values. this _Line returns an array // at each step. arguments[0] and [1] in this example.
The dojox.fx._Timeline object from which an instance is created
Parameter | Type | Description |
---|---|---|
keys | Array |
Animate the effects of adding a class to a node
Creates an animation that will animate the properties of a node to the properties defined in a standard CSS .class definition. (calculating the differences itself)
Parameter | Type | Description |
---|---|---|
node | String | DomNode | A String ID or DomNode referce to animate |
cssClass | String | The CSS class name to add to the node |
args | Object |
Optional Additional optional |
.bar { line-height: 12px; } .foo { line-height: 40px; } <div class="bar" id="test"> Multi<br>line<br>text </div> // animate to line-height:40px dojo.fx.addClass("test", "foo").play();
An add-on to dojo.fx that provides the ability to create a complex property animation based on an array of "keyframes".
The Timeline is a replacement for the default dojo._Line. Instead of _Line.getValue returning a float between 0-1, _Timeline.getValue returns an object with all properties and their current values. A property does not have to appear in every keyframe. As in the example below, "height" is transitioned from the first keyframe to the third. "width" is transitioned from the first to the second to the third. Each keyframe can accept the following custom properties:
Parameter | Type | Description |
---|---|---|
options | Object | The parameters passed to the timeline animation. Includes:
|
node | DOMNode | The node to manipulate |
var keys = [ { step:"0px", ease:"quadInOut", width:"50px", height:"50px", },{ step:"25%", width:"190px" },{ step:"100%", width:"10px", height:"200px", } ]; ani = dojox.fx.animateTimeline({keys:keys, duration:2000}, "myDiv").play();
Animate a node flipping following a specific direction
Returns an animation that will flip the node around a central axis:
if args.dir is "left" or "right" --> y axis
if args.dir is "top" or "bottom" --> x axis
This effect is obtained using a border distortion applied to a helper node.
The user can specify three background colors for the helper node:
Other arguments:
depth: Float
whichAnim: String
axis: String
shift: Integer: node translation, perpendicular to the rotation axis
Parameter | Type | Description |
---|---|---|
args | Object |
var anim = dojox.fx.flip({ node: dojo.byId("nodeId"), dir: "top", darkColor: "#555555", lightColor: "#dddddd", endColor: "#666666", depth: .5, shift: 50, duration:300 });
An extension to dojox.fx.flip
providing a more 3d-like rotation
An extension to dojox.fx.flip
providing a more 3d-like rotation.
Behaves the same as dojox.fx.flip
, using the same attributes and
other standard dojo.Animation
properties.
Parameter | Type | Description |
---|---|---|
args | Object |
See dojox.fx.flip
An extension to dojox.fx.flip
providing a decomposition in rows * cols flipping elements
An extension to dojox.fx.flip
providing a page flip effect.
Behaves the same as dojox.fx.flip
, using the same attributes and
other standard dojo.Animation
properties and
Parameter | Type | Description |
---|---|---|
args | Object |
See dojox.fx.flip
An extension to dojox.fx.flip
providing a page flip like animation.
An extension to dojox.fx.flip
providing a page flip effect.
Behaves the same as dojox.fx.flip
, using the same attributes and
other standard dojo.Animation
properties.
Parameter | Type | Description |
---|---|---|
args | Object |
See dojox.fx.flip
Animate the effects of removing a class from a node
Creates an animation that will animate the properties of a node (args.node) to the properties calculated after removing a standard CSS className from a that node.
calls dojo.removeClass(args.cssClass) onEnd of animation
standard dojo.Animation object rules apply.
Parameter | Type | Description |
---|---|---|
node | undefined | |
cssClass | undefined | |
args | undefined |
// animate the removal of "foo" from a node with id="bar" dojox.fx.removeClass("bar", "foo").play()
Returns an animation that will smooth-scroll to a node
This implementation support either horizontal or vertical scroll, as well as both. In addition, element in iframe can be scrolled to correctly.
Parameter | Type | Description |
---|---|---|
args | Object |
|
Animate the effects of Toggling a class on a Node
creates an animation that will animate the effect of toggling a class on or off of a node. Adds a class to node if not present, or removes if present. Pass a boolean condition if you want to explicitly add or remove.
Parameter | Type | Description |
---|---|---|
node | String | DomNode | The domNode (or string of the id) to toggle |
cssClass | String | String of the classname to add to the node |
condition | Boolean |
Optional If passed, true means to add the class, false means to remove. |
args | Object |
Optional Additional |
// add the class "sampleClass" to a node id="theNode" dojox.fx.toggleClass("theNode","sampleClass",true).play();
// toggle the class "sampleClass" on the node id="theNode" dojox.fx.toggleClass("theNode","sampleClass").play();