1 /* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
4 * A static factory class for tree view expand/collapse animations
8 YAHOO.widget.TVAnim = new function() {
10 * Constant for the fade in animation
14 this.FADE_IN = "YAHOO.widget.TVFadeIn";
17 * Constant for the fade out animation
21 this.FADE_OUT = "YAHOO.widget.TVFadeOut";
24 * Returns a ygAnim instance of the given type
26 * @param type {string} the type of animation
27 * @param el {HTMLElement} the element to element (probably the children div)
28 * @param callback {function} function to invoke when the animation is done.
29 * @return {YAHOO.util.Animation} the animation instance
31 this.getAnim = function(type, el, callback) {
33 case this.FADE_IN: return new YAHOO.widget.TVFadeIn(el, callback);
34 case this.FADE_OUT: return new YAHOO.widget.TVFadeOut(el, callback);
40 * Returns true if the specified animation class is available
42 * @param type {string} the type of animation
43 * @return {boolean} true if valid, false if not
45 this.isValid = function(type) {
46 return ( "undefined" != eval("typeof " + type) );