1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <title>API: treeview TVAnim.js (YUI Library)
</title>
5 <link rel=
"stylesheet" type=
"text/css" href=
"assets/api.css">
9 <div id=
"doc3" class=
"yui-t2">
12 <h1>Yahoo! UI Library
</h1>
13 <h3>TreeView Widget
<span class=
"subtitle">2.2.0</span></h3>
15 <a href=
"./index.html">Yahoo! UI Library
</a>
16 > <a href=
"./module_treeview.html">treeview
</a>
18 > TVAnim.js (source view)
27 <div class=
"highlight" ><pre><span class=
"c">/**
</span>
28 <span class=
"c"> * A static factory class for tree view expand/collapse animations
</span>
29 <span class=
"c"> * @class TVAnim
</span>
30 <span class=
"c"> * @static
</span>
31 <span class=
"c"> */
</span>
32 <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">.
</span><span class=
"nx">TVAnim
</span> <span class=
"o">=
</span> <span class=
"k">function
</span><span class=
"o">()
</span> <span class=
"o">{
</span>
33 <span class=
"k">return
</span> <span class=
"o">{
</span>
34 <span class=
"c">/**
</span>
35 <span class=
"c"> * Constant for the fade in animation
</span>
36 <span class=
"c"> * @property FADE_IN
</span>
37 <span class=
"c"> * @type string
</span>
38 <span class=
"c"> * @static
</span>
39 <span class=
"c"> */
</span>
40 <span class=
"nx">FADE_IN
</span><span class=
"o">:
</span> <span class=
"s2">"TVFadeIn
"</span><span class=
"o">,
</span>
42 <span class=
"c">/**
</span>
43 <span class=
"c"> * Constant for the fade out animation
</span>
44 <span class=
"c"> * @property FADE_OUT
</span>
45 <span class=
"c"> * @type string
</span>
46 <span class=
"c"> * @static
</span>
47 <span class=
"c"> */
</span>
48 <span class=
"nx">FADE_OUT
</span><span class=
"o">:
</span> <span class=
"s2">"TVFadeOut
"</span><span class=
"o">,
</span>
50 <span class=
"c">/**
</span>
51 <span class=
"c"> * Returns a ygAnim instance of the given type
</span>
52 <span class=
"c"> * @method getAnim
</span>
53 <span class=
"c"> * @param type {string} the type of animation
</span>
54 <span class=
"c"> * @param el {HTMLElement} the element to element (probably the children div)
</span>
55 <span class=
"c"> * @param callback {function} function to invoke when the animation is done.
</span>
56 <span class=
"c"> * @return {YAHOO.util.Animation} the animation instance
</span>
57 <span class=
"c"> * @static
</span>
58 <span class=
"c"> */
</span>
59 <span class=
"nx">getAnim
</span><span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">type
</span><span class=
"o">,
</span> <span class=
"nx">el
</span><span class=
"o">,
</span> <span class=
"nx">callback
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
60 <span class=
"k">if
</span> <span class=
"o">(
</span><span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">[
</span><span class=
"nx">type
</span><span class=
"o">])
</span> <span class=
"o">{
</span>
61 <span class=
"k">return
</span> <span class=
"k">new
</span> <span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">[
</span><span class=
"nx">type
</span><span class=
"o">](
</span><span class=
"nx">el
</span><span class=
"o">,
</span> <span class=
"nx">callback
</span><span class=
"o">);
</span>
62 <span class=
"o">}
</span> <span class=
"k">else
</span> <span class=
"o">{
</span>
63 <span class=
"k">return
</span> <span class=
"kc">null
</span><span class=
"o">;
</span>
64 <span class=
"o">}
</span>
65 <span class=
"o">},
</span>
67 <span class=
"c">/**
</span>
68 <span class=
"c"> * Returns true if the specified animation class is available
</span>
69 <span class=
"c"> * @method isValid
</span>
70 <span class=
"c"> * @param type {string} the type of animation
</span>
71 <span class=
"c"> * @return {boolean} true if valid, false if not
</span>
72 <span class=
"c"> * @static
</span>
73 <span class=
"c"> */
</span>
74 <span class=
"nx">isValid
</span><span class=
"o">:
</span> <span class=
"k">function
</span><span class=
"o">(
</span><span class=
"nx">type
</span><span class=
"o">)
</span> <span class=
"o">{
</span>
75 <span class=
"k">return
</span> <span class=
"o">(
</span><span class=
"nx">YAHOO
</span><span class=
"o">.
</span><span class=
"nx">widget
</span><span class=
"o">[
</span><span class=
"nx">type
</span><span class=
"o">]);
</span>
76 <span class=
"o">}
</span>
77 <span class=
"o">};
</span>
78 <span class=
"o">}
</span> <span class=
"o">();
</span>
90 <li class=
""><a href=
"module_animation.html">animation
</a></li>
92 <li class=
""><a href=
"module_autocomplete.html">autocomplete
</a></li>
94 <li class=
""><a href=
"module_button.html">button
</a></li>
96 <li class=
""><a href=
"module_calendar.html">calendar
</a></li>
98 <li class=
""><a href=
"module_connection.html">connection
</a></li>
100 <li class=
""><a href=
"module_container.html">container
</a></li>
102 <li class=
""><a href=
"module_datasource.html">datasource
</a></li>
104 <li class=
""><a href=
"module_datatable.html">datatable
</a></li>
106 <li class=
""><a href=
"module_dom.html">dom
</a></li>
108 <li class=
""><a href=
"module_dragdrop.html">dragdrop
</a></li>
110 <li class=
""><a href=
"module_element.html">element
</a></li>
112 <li class=
""><a href=
"module_event.html">event
</a></li>
114 <li class=
""><a href=
"module_history.html">history
</a></li>
116 <li class=
""><a href=
"module_logger.html">logger
</a></li>
118 <li class=
""><a href=
"module_menu.html">menu
</a></li>
120 <li class=
""><a href=
"module_slider.html">slider
</a></li>
122 <li class=
""><a href=
"module_tabview.html">tabview
</a></li>
124 <li class=
"selected"><a href=
"module_treeview.html">treeview
</a></li>
126 <li class=
""><a href=
"module_yahoo.html">yahoo
</a></li>
133 <li class=
""><a href=
"YAHOO.widget.HTMLNode.html">YAHOO.widget.HTMLNode
</a></li>
134 <li class=
""><a href=
"YAHOO.widget.MenuNode.html">YAHOO.widget.MenuNode
</a></li>
135 <li class=
""><a href=
"YAHOO.widget.Node.html">YAHOO.widget.Node
</a></li>
136 <li class=
""><a href=
"YAHOO.widget.RootNode.html">YAHOO.widget.RootNode
</a></li>
137 <li class=
""><a href=
"YAHOO.widget.TextNode.html">YAHOO.widget.TextNode
</a></li>
138 <li class=
""><a href=
"YAHOO.widget.TreeView.html">YAHOO.widget.TreeView
</a></li>
139 <li class=
""><a href=
"YAHOO.widget.TVAnim.html">YAHOO.widget.TVAnim
</a></li>
140 <li class=
""><a href=
"YAHOO.widget.TVFadeIn.html">YAHOO.widget.TVFadeIn
</a></li>
141 <li class=
""><a href=
"YAHOO.widget.TVFadeOut.html">YAHOO.widget.TVFadeOut
</a></li>
148 <li class=
""><a href=
"HTMLNode.js.html">HTMLNode.js
</a></li>
149 <li class=
""><a href=
"MenuNode.js.html">MenuNode.js
</a></li>
150 <li class=
""><a href=
"Node.js.html">Node.js
</a></li>
151 <li class=
""><a href=
"RootNode.js.html">RootNode.js
</a></li>
152 <li class=
""><a href=
"TextNode.js.html">TextNode.js
</a></li>
153 <li class=
""><a href=
"TreeView.js.html">TreeView.js
</a></li>
154 <li class=
"selected"><a href=
"TVAnim.js.html">TVAnim.js
</a></li>
155 <li class=
""><a href=
"TVFadeIn.js.html">TVFadeIn.js
</a></li>
156 <li class=
""><a href=
"TVFadeOut.js.html">TVFadeOut.js
</a></li>
169 Copyright
© 2007 Yahoo! Inc. All rights reserved.