# Yahoo! UI Library

### widget-anim 3.3.0

Yahoo! UI Library > widget-anim > Plugin.WidgetAnim
Search:
Filters Show Private Show Protected Show Deprecated

## Class Plugin.WidgetAnim - extends Plugin.Base

A plugin class which can be used to animate widget visibility changes.

### Properties

#### WidgetAnim.ANIMATIONS - `static Object`

Pre-Packaged Animation implementations, which can be used for animShow and animHide attribute values.
Default Value: "pluginWidgetAnim"

#### WidgetAnim.ATTRS - `static Object`

Static property used to define the default attribute configuration for the plugin.

#### WidgetAnim.NAME - `static String`

The NAME of the WidgetAnim class. Used to prefix events generated by the plugin class.
Default Value: "pluginWidgetAnim"

#### WidgetAnim.NS - `static String`

The namespace for the plugin. This will be the property on the widget, which will reference the plugin instance, when it's plugged in.
Default Value: "anim"

#### Properties inherited from Plugin.Host:

`PluginHost`

#### Properties inherited from Attribute:

``

#### Properties inherited from Base:

`name`

#### Properties inherited from Plugin.Base:

`_handles`

### Methods

#### _bindAnimHide

`private void _bindAnimHide ( )`
Binds a listener to invoke the original visibility handling when the animHide animation is complete

#### _bindAnimShow

`private void _bindAnimShow ( )`
Binds a listener to invoke the original visibility handling when the animShow animation is started

#### _uiAnimSetVisible

`protected void _uiAnimSetVisible ( val )`
The injected method used to override the host widget's _uiSetVisible implementation with an animated version of the same.

This method replaces the default _uiSetVisible handler Widget provides, by injecting itself before _uiSetVisible, and preventing the default behavior.

Parameters:
  `val <boolean>` true, if making the widget visible. false, if hiding it.

#### _uiSetVisible

`private void _uiSetVisible ( val )`
The original Widget _uiSetVisible implementation. This currently needs to be replicated, so it can be invoked before or after the animation starts or stops, since the original methods is not available to the AOP implementation.

Parameters:
  `val <boolean>` true, if making the widget visible. false, if hiding it.

#### destructor

`void destructor ( )`
The initializer destructor implementation. Responsible for destroying the configured animation instances.

#### initializer

`void initializer ( config )`
The initializer lifecycle implementation. Modifies the host widget's visibililty implementation to add animation.

Parameters:
  `config <Object>` The user configuration for the plugin

#### Methods inherited from EventTarget:

`_getType, _monitor, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, getTargets, on, once, parseType, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrCfg, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from Plugin.Host:

`_destroyPlugins, _initPlugins, hasPlugin, plug, unplug`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, _preInitEventCfg, destroy, init, toString`

#### Methods inherited from Plugin.Base:

`afterHostEvent, afterHostMethod, beforeHostMethod, destructor, doAfter, doBefore, initializer, onHostEvent`

### Events

#### animHideChange

`animHideChange ( event )`
Fires when the value for the configuration attribute 'animHide' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### animShowChange

`animShowChange ( event )`
Fires when the value for the configuration attribute 'animShow' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### durationChange

`durationChange ( event )`
Fires when the value for the configuration attribute 'duration' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### Events inherited from Base:

`destroy, destroyedChange, init, initializedChange,`

#### Events inherited from Plugin.Base:

`hostChange,`

### Configuration Attributes

#### animHide `- Anim`

Default animation instance used for hiding the widget (opacity fade-out)
Default Value: WidgetAnim.ANIMATIONS.fadeOut

#### animShow `- Anim`

Default animation instance used for showing the widget (opacity fade-in)
Default Value: WidgetAnim.ANIMATIONS.fadeIn

#### duration `- Number`

Default duration in seconds. Used as the default duration for the default animation implementations
Default Value: 0.2 (seconds

#### Configuration attributes inherited from Base:

`destroyed initialized`

#### Configuration attributes inherited from Plugin.Base:

`host`

Copyright © 2011 Yahoo! Inc. All rights reserved.