W3cubDocs

/Dojo

dojo/fx.Toggler

Summary

A simple dojo.Animation toggler API.

class constructor for an animation toggler. It accepts a packed set of arguments about what type of animation to use in each direction, duration, etc. All available members are mixed into these animations from the constructor (for example, node, showDuration, hideDuration).

Usage

var foo = new fx.Toggler(args);

dojo/fx/Toggler

Parameter Type Description
args undefined

Examples

Example 1

var t = new dojo/fx/Toggler({
    node: "nodeId",
    showDuration: 500,
    // hideDuration will default to "200"
    showFunc: dojo/fx/wipeIn,
    // hideFunc will default to "fadeOut"
});
t.show(100); // delay showing for 100ms
// ...time passes...
t.hide();

Properties

hideDuration

Defined by: dojo/fx/Toggler

Time in milliseconds to run the hide Animation

node

Defined by: dojo/fx/Toggler

the node to target for the showing and hiding animations

showDuration

Defined by: dojo/fx/Toggler

Time in milliseconds to run the show Animation

Methods

hide(delay)

Defined by dojo/fx/Toggler

Toggle the node to hidden

Parameter Type Description
delay Integer
Optional

Amount of time to stall playing the hide animation

Returns: undefined

hideFunc(args)

Defined by dojo/fx/Toggler

The function that returns the dojo.Animation to hide the node

Parameter Type Description
args Object

An object with the following properties:

  • node (DOMNode|String):

    The node referenced in the animation

  • duration (Integer, optional):

    Duration of the animation in milliseconds.

  • easing (Function, optional):

    An easing function.

Returns: undefined

show(delay)

Defined by dojo/fx/Toggler

Toggle the node to showing

Parameter Type Description
delay Integer
Optional

Amount of time to stall playing the show animation

Returns: undefined

showFunc(args)

Defined by dojo/fx/Toggler

The function that returns the dojo.Animation to show the node

Parameter Type Description
args Object

An object with the following properties:

  • node (DOMNode|String):

    The node referenced in the animation

  • duration (Integer, optional):

    Duration of the animation in milliseconds.

  • easing (Function, optional):

    An easing function.

Returns: undefined

© 2005–2017 JS Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/fx.Toggler.html