Class: Fx.Tween.Toggle {#Fx.Tween.Toggle}

Extends Fx.Tween to store and execute toggling of the effect.

Demo

Extends:

Fx.Tween

Fx.Tween.Toggle Method: constructor {#Fx.Tween.Toggle:constructor}

Syntax:

var myToggle = new Fx.Tween.Toggle(element, options);

Arguments:

  1. element - (mixed) An Element or the string id of an Element to apply the transition to.
  2. options - (object) The Fx.Tween options object, plus the options described below:

Options:

Events:

Example:

var myToggle = new Fx.Tween.Toggle('element',{
    property: 'height',
    from: 0,
    to: 300,
    link: 'cancel',
    onToggle: function(){
        // do stuff
    }
}).setIn();

Fx.Tween.Toggle Method: toggle {#Fx.Tween.Toggle:toggle}

Toggles the element in our out, depending on it's current status.

Syntax:

myToggle.toggle();

Returns:

This Fx.Tween.Toggle instance.

Fx.Tween.Toggle Method: toggleIn {#Fx.Tween.Toggle:toggleIn}

Toggles the element in (options.to value), if already toggled in, nothing happens

Syntax:

myToggle.toggleIn();

Returns:

This Fx.Tween.Toggle instance

Fx.Tween.Toggle Method: toggleOut {#Fx.Tween.Toggle:toggleOut}

Toggles the element out (options.from value), if already toggled in, nothing happens

Syntax:

myToggle.toggleOut();

Returns:

This Fx.Tween.Toggle instance

Fx.Tween.Toggle Method: setIn {#Fx.Tween.Toggle:setIn}

Immediately sets the element to the options.to value without an animation.

Syntax:

myToggle.setIn();

Returns:

This Fx.Tween.Toggle instance.

Fx.Tween.Toggle Method: setOut {#Fx.Tween.Toggle:setOut}

Immediately sets the element to the options.from state without an animation.

Syntax:

myToggle.setIn();

Returns:

This Fx.Tween.Toggle instance.