dojox/fx/style (version 1.10)

Summary

dojox.fx CSS Class Animations

a set of functions to animate properties based on normalized CSS class definitions.

See the dojox/fx/style reference documentation for more information.

Property Summary

Method Summary

  • addClass(node,cssClass,args) Animate the effects of adding a class to a node
  • removeClass(node,cssClass,args) Animate the effects of removing a class from a node
  • toggleClass(node,cssClass,condition,args) Animate the effects of Toggling a class on a Node

Properties

_allowedProperties
Defined by: dojox/fx/style

Methods

addClass(node,cssClass,args)
Defined by dojox/fx/style

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 dojo.animateProperty arguments, such as duration, easing and so on.

Returns:undefined

Examples

Example 1

   .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();
removeClass(node,cssClass,args)
Defined by dojox/fx/style

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
Returns:undefined

Examples

Example 1

// animate the removal of "foo" from a node with id="bar"
dojox.fx.removeClass("bar", "foo").play()
toggleClass(node,cssClass,condition,args)
Defined by dojox/fx/style

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 dojo.Animation args to pass along.

Returns:undefined

Examples

Example 1

// add the class "sampleClass" to a node id="theNode"
dojox.fx.toggleClass("theNode","sampleClass",true).play();

Example 2

// toggle the class "sampleClass" on the node id="theNode"
dojox.fx.toggleClass("theNode","sampleClass").play();
Error in the documentation? Can’t find what you are looking for? Let us know!