| changeset 0 | 40c8f766c9b8 |
| -1:000000000000 | 0:40c8f766c9b8 |
|---|---|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
2 <html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#"> |
|
3 <head> |
|
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
5 <title>API: anim anim-scroll.js (YUI Library)</title> |
|
6 |
|
7 <link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" /> |
|
8 <link rel="stylesheet" type="text/css" href="assets/api.css" /> |
|
9 |
|
10 <script type="text/javascript" src="assets/api-js"></script> |
|
11 <script type="text/javascript" src="assets/ac-js"></script> |
|
12 </head> |
|
13 |
|
14 <body id="yahoo-com"> |
|
15 |
|
16 <div id="doc3" class="yui-t2"> |
|
17 <div id="hd"> |
|
18 <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1> |
|
19 <h3>anim <span class="subtitle">3.0.0b1</span></h3> |
|
20 <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> |
|
21 > <a href="./module_anim.html" title="anim">anim</a> |
|
22 |
|
23 > anim-scroll.js (source view) |
|
24 <form onsubmit="return false"> |
|
25 <div id="propertysearch"> |
|
26 Search: <input autocomplete="off" id="searchinput" /> |
|
27 <div id="searchresults"> |
|
28 |
|
29 </div> |
|
30 </div> |
|
31 </form> |
|
32 </div> |
|
33 |
|
34 <div id="bd"> |
|
35 <div id="yui-main"> |
|
36 <div class="yui-b"> |
|
37 <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form"> |
|
38 <fieldset> |
|
39 <legend>Filters</legend> |
|
40 <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span> |
|
41 <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span> |
|
42 <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span> |
|
43 </fieldset> |
|
44 </form> |
|
45 |
|
46 <div id="srcout"> |
|
47 <style> |
|
48 #doc3 .classopts { display:none; } |
|
49 </style> |
|
50 <div class="highlight" ><pre><span class="c">/**</span> |
|
51 <span class="c"> * Adds support for the <code>scroll</code> property in <code>to</code></span> |
|
52 <span class="c"> * and <code>from</code> attributes.</span> |
|
53 <span class="c"> * @module anim</span> |
|
54 <span class="c"> * @submodule anim-scroll</span> |
|
55 <span class="c"> */</span> |
|
56 |
|
57 <span class="k">var</span> <span class="nx">NUM</span> <span class="o">=</span> <span class="nb">Number</span><span class="o">;</span> |
|
58 |
|
59 <span class="c">//TODO: deprecate for scrollTop/Left properties?</span> |
|
60 <span class="c"></span><span class="nx">Y</span><span class="o">.</span><span class="nx">Anim</span><span class="o">.</span><span class="nx">behaviors</span><span class="o">.</span><span class="nx">scroll</span> <span class="o">=</span> <span class="o">{</span> |
|
61 <span class="nx">set</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">anim</span><span class="o">,</span> <span class="nx">att</span><span class="o">,</span> <span class="nx">from</span><span class="o">,</span> <span class="nx">to</span><span class="o">,</span> <span class="nx">elapsed</span><span class="o">,</span> <span class="nx">duration</span><span class="o">,</span> <span class="nx">fn</span><span class="o">)</span> <span class="o">{</span> |
|
62 <span class="k">var</span> |
|
63 <span class="nx">node</span> <span class="o">=</span> <span class="nx">anim</span><span class="o">.</span><span class="nx">_node</span><span class="o">,</span> |
|
64 <span class="nx">val</span> <span class="o">=</span> <span class="o">([</span> |
|
65 <span class="nx">fn</span><span class="o">(</span><span class="nx">elapsed</span><span class="o">,</span> <span class="nx">NUM</span><span class="o">(</span><span class="nx">from</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span> <span class="nx">NUM</span><span class="o">(</span><span class="nx">to</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">-</span> <span class="nx">NUM</span><span class="o">(</span><span class="nx">from</span><span class="o">[</span><span class="m">0</span><span class="o">]),</span> <span class="nx">duration</span><span class="o">),</span> |
|
66 <span class="nx">fn</span><span class="o">(</span><span class="nx">elapsed</span><span class="o">,</span> <span class="nx">NUM</span><span class="o">(</span><span class="nx">from</span><span class="o">[</span><span class="m">1</span><span class="o">]),</span> <span class="nx">NUM</span><span class="o">(</span><span class="nx">to</span><span class="o">[</span><span class="m">1</span><span class="o">])</span> <span class="o">-</span> <span class="nx">NUM</span><span class="o">(</span><span class="nx">from</span><span class="o">[</span><span class="m">1</span><span class="o">]),</span> <span class="nx">duration</span><span class="o">)</span> |
|
67 <span class="o">]);</span> |
|
68 |
|
69 <span class="k">if</span> <span class="o">(</span><span class="nx">val</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span> |
|
70 <span class="nx">node</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">'scrollLeft'</span><span class="o">,</span> <span class="nx">val</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span> |
|
71 <span class="o">}</span> |
|
72 |
|
73 <span class="k">if</span> <span class="o">(</span><span class="nx">val</span><span class="o">[</span><span class="m">1</span><span class="o">])</span> <span class="o">{</span> |
|
74 <span class="nx">node</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">'scrollTop'</span><span class="o">,</span> <span class="nx">val</span><span class="o">[</span><span class="m">1</span><span class="o">]);</span> |
|
75 <span class="o">}</span> |
|
76 <span class="o">},</span> |
|
77 <span class="nx">get</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">anim</span><span class="o">)</span> <span class="o">{</span> |
|
78 <span class="k">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="nx">anim</span><span class="o">.</span><span class="nx">_node</span><span class="o">;</span> |
|
79 <span class="k">return</span> <span class="o">[</span><span class="nx">node</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">'scrollLeft'</span><span class="o">),</span> <span class="nx">node</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">'scrollTop'</span><span class="o">)];</span> |
|
80 <span class="o">}</span> |
|
81 <span class="o">};</span> |
|
82 </pre></div> |
|
83 </div> |
|
84 </div> |
|
85 </div> |
|
86 <div class="yui-b"> |
|
87 <div class="nav"> |
|
88 |
|
89 <div id="moduleList" class="module"> |
|
90 <h4>Modules</h4> |
|
91 <ul class="content"> |
|
92 <li class="selected"><a href="module_anim.html" title="anim">anim</a></li> |
|
93 <li class=""><a href="module_attribute.html" title="attribute">attribute</a></li> |
|
94 <li class=""><a href="module_base.html" title="base">base</a></li> |
|
95 <li class=""><a href="module_cache.html" title="cache">cache</a></li> |
|
96 <li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li> |
|
97 <li class=""><a href="module_collection.html" title="collection">collection</a></li> |
|
98 <li class=""><a href="module_console.html" title="console">console</a></li> |
|
99 <li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li> |
|
100 <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li> |
|
101 <li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li> |
|
102 <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li> |
|
103 <li class=""><a href="module_datatype.html" title="datatype">datatype</a></li> |
|
104 <li class=""><a href="module_dd.html" title="dd">dd</a></li> |
|
105 <li class=""><a href="module_dom.html" title="dom">dom</a></li> |
|
106 <li class=""><a href="module_dump.html" title="dump">dump</a></li> |
|
107 <li class=""><a href="module_event.html" title="event">event</a></li> |
|
108 <li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li> |
|
109 <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li> |
|
110 <li class=""><a href="module_history.html" title="history">history</a></li> |
|
111 <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li> |
|
112 <li class=""><a href="module_io.html" title="io">io</a></li> |
|
113 <li class=""><a href="module_json.html" title="json">json</a></li> |
|
114 <li class=""><a href="module_node.html" title="node">node</a></li> |
|
115 <li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li> |
|
116 <li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li> |
|
117 <li class=""><a href="module_oop.html" title="oop">oop</a></li> |
|
118 <li class=""><a href="module_overlay.html" title="overlay">overlay</a></li> |
|
119 <li class=""><a href="module_plugin.html" title="plugin">plugin</a></li> |
|
120 <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li> |
|
121 <li class=""><a href="module_queue.html" title="queue">queue</a></li> |
|
122 <li class=""><a href="module_slider.html" title="slider">slider</a></li> |
|
123 <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li> |
|
124 <li class=""><a href="module_substitute.html" title="substitute">substitute</a></li> |
|
125 <li class=""><a href="module_test.html" title="test">test</a></li> |
|
126 <li class=""><a href="module_widget.html" title="widget">widget</a></li> |
|
127 <li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li> |
|
128 <li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li> |
|
129 <li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li> |
|
130 <li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li> |
|
131 <li class=""><a href="module_yui.html" title="yui">yui</a></li> |
|
132 </ul> |
|
133 </div> |
|
134 |
|
135 <div id="classList" class="module"> |
|
136 <h4>Classes</h4> |
|
137 <ul class="content"> |
|
138 <li class=""><a href="Anim.html" title="Anim">Anim</a></li> |
|
139 <li class=""><a href="Easing.html" title="Easing">Easing</a></li> |
|
140 <li class=""><a href="Plugin.NodeFX.html" title="Plugin.NodeFX">Plugin.NodeFX</a></li> |
|
141 </ul> |
|
142 </div> |
|
143 |
|
144 <div id="fileList" class="module"> |
|
145 <h4>Files</h4> |
|
146 <ul class="content"> |
|
147 <li class=""><a href="anim-color.js.html" title="anim-color.js">anim-color.js</a></li> |
|
148 <li class=""><a href="anim-curve.js.html" title="anim-curve.js">anim-curve.js</a></li> |
|
149 <li class=""><a href="anim-easing.js.html" title="anim-easing.js">anim-easing.js</a></li> |
|
150 <li class=""><a href="anim-node-plugin.js.html" title="anim-node-plugin.js">anim-node-plugin.js</a></li> |
|
151 <li class="selected"><a href="anim-scroll.js.html" title="anim-scroll.js">anim-scroll.js</a></li> |
|
152 <li class=""><a href="anim-xy.js.html" title="anim-xy.js">anim-xy.js</a></li> |
|
153 <li class=""><a href="anim.js.html" title="anim.js">anim.js</a></li> |
|
154 </ul> |
|
155 </div> |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 </div> |
|
162 </div> |
|
163 </div> |
|
164 <div id="ft"> |
|
165 <hr /> |
|
166 Copyright © 2009 Yahoo! Inc. All rights reserved. |
|
167 </div> |
|
168 </div> |
|
169 <script type="text/javascript"> |
|
170 ALL_YUI_PROPS = [{"access": "", "host": "Easing", "name": "backBoth", "url": "Easing.html#method_backBoth", "type": "method"}, {"access": "", "host": "Easing", "name": "backIn", "url": "Easing.html#method_backIn", "type": "method"}, {"access": "", "host": "Easing", "name": "backOut", "url": "Easing.html#method_backOut", "type": "method"}, {"access": "", "host": "Anim", "name": "behaviors", "url": "Anim.html#property_behaviors", "type": "property"}, {"access": "", "host": "Easing", "name": "bounceBoth", "url": "Easing.html#method_bounceBoth", "type": "method"}, {"access": "", "host": "Easing", "name": "bounceIn", "url": "Easing.html#method_bounceIn", "type": "method"}, {"access": "", "host": "Easing", "name": "bounceOut", "url": "Easing.html#method_bounceOut", "type": "method"}, {"access": "", "host": "Anim", "name": "DEFAULT_GETTER", "url": "Anim.html#property_DEFAULT_GETTER", "type": "property"}, {"access": "", "host": "Anim", "name": "DEFAULT_SETTER", "url": "Anim.html#property_DEFAULT_SETTER", "type": "property"}, {"access": "", "host": "Anim", "name": "DEFAULT_UNIT", "url": "Anim.html#property_DEFAULT_UNIT", "type": "property"}, {"access": "", "host": "Anim", "name": "direction", "url": "Anim.html#config_direction", "type": "config"}, {"access": "", "host": "Anim", "name": "directionChange", "url": "Anim.html#event_directionChange", "type": "event"}, {"access": "", "host": "Anim", "name": "duration", "url": "Anim.html#config_duration", "type": "config"}, {"access": "", "host": "Anim", "name": "durationChange", "url": "Anim.html#event_durationChange", "type": "event"}, {"access": "", "host": "Easing", "name": "easeBoth", "url": "Easing.html#method_easeBoth", "type": "method"}, {"access": "", "host": "Easing", "name": "easeBothStrong", "url": "Easing.html#method_easeBothStrong", "type": "method"}, {"access": "", "host": "Easing", "name": "easeIn", "url": "Easing.html#method_easeIn", "type": "method"}, {"access": "", "host": "Easing", "name": "easeInStrong", "url": "Easing.html#method_easeInStrong", "type": "method"}, {"access": "", "host": "Easing", "name": "easeNone", "url": "Easing.html#method_easeNone", "type": "method"}, {"access": "", "host": "Easing", "name": "easeOut", "url": "Easing.html#method_easeOut", "type": "method"}, {"access": "", "host": "Easing", "name": "easeOutStrong", "url": "Easing.html#method_easeOutStrong", "type": "method"}, {"access": "", "host": "Anim", "name": "easing", "url": "Anim.html#config_easing", "type": "config"}, {"access": "", "host": "Anim", "name": "easingChange", "url": "Anim.html#event_easingChange", "type": "event"}, {"access": "", "host": "Anim", "name": "elapsedTime", "url": "Anim.html#config_elapsedTime", "type": "config"}, {"access": "", "host": "Anim", "name": "elapsedTimeChange", "url": "Anim.html#event_elapsedTimeChange", "type": "event"}, {"access": "", "host": "Easing", "name": "elasticBoth", "url": "Easing.html#method_elasticBoth", "type": "method"}, {"access": "", "host": "Easing", "name": "elasticIn", "url": "Easing.html#method_elasticIn", "type": "method"}, {"access": "", "host": "Easing", "name": "elasticOut", "url": "Easing.html#method_elasticOut", "type": "method"}, {"access": "", "host": "Anim", "name": "end", "url": "Anim.html#event_end", "type": "event"}, {"access": "", "host": "Anim", "name": "from", "url": "Anim.html#config_from", "type": "config"}, {"access": "", "host": "Anim", "name": "fromChange", "url": "Anim.html#event_fromChange", "type": "event"}, {"access": "", "host": "Anim", "name": "getBezier", "url": "Anim.html#method_getBezier", "type": "method"}, {"access": "", "host": "Anim", "name": "iteration", "url": "Anim.html#event_iteration", "type": "event"}, {"access": "", "host": "Anim", "name": "iterationCount", "url": "Anim.html#config_iterationCount", "type": "config"}, {"access": "", "host": "Anim", "name": "iterationCountChange", "url": "Anim.html#event_iterationCountChange", "type": "event"}, {"access": "", "host": "Anim", "name": "iterations", "url": "Anim.html#config_iterations", "type": "config"}, {"access": "", "host": "Anim", "name": "iterationsChange", "url": "Anim.html#event_iterationsChange", "type": "event"}, {"access": "", "host": "Anim", "name": "node", "url": "Anim.html#config_node", "type": "config"}, {"access": "", "host": "Anim", "name": "nodeChange", "url": "Anim.html#event_nodeChange", "type": "event"}, {"access": "", "host": "Anim", "name": "pause", "url": "Anim.html#method_pause", "type": "method"}, {"access": "", "host": "Anim", "name": "pause", "url": "Anim.html#event_pause", "type": "event"}, {"access": "", "host": "Anim", "name": "RE_DEFAULT_UNIT", "url": "Anim.html#property_RE_DEFAULT_UNIT", "type": "property"}, {"access": "", "host": "Anim", "name": "resume", "url": "Anim.html#event_resume", "type": "event"}, {"access": "", "host": "Anim", "name": "reverse", "url": "Anim.html#config_reverse", "type": "config"}, {"access": "", "host": "Anim", "name": "reverseChange", "url": "Anim.html#event_reverseChange", "type": "event"}, {"access": "", "host": "Anim", "name": "run", "url": "Anim.html#method_run", "type": "method"}, {"access": "private", "host": "Anim", "name": "_runFrame", "url": "Anim.html#method__runFrame", "type": "method"}, {"access": "", "host": "Anim", "name": "running", "url": "Anim.html#config_running", "type": "config"}, {"access": "", "host": "Anim", "name": "runningChange", "url": "Anim.html#event_runningChange", "type": "event"}, {"access": "", "host": "Anim", "name": "start", "url": "Anim.html#event_start", "type": "event"}, {"access": "", "host": "Anim", "name": "startTime", "url": "Anim.html#config_startTime", "type": "config"}, {"access": "", "host": "Anim", "name": "startTimeChange", "url": "Anim.html#event_startTimeChange", "type": "event"}, {"access": "", "host": "Anim", "name": "stop", "url": "Anim.html#method_stop", "type": "method"}, {"access": "", "host": "Anim", "name": "to", "url": "Anim.html#config_to", "type": "config"}, {"access": "", "host": "Anim", "name": "toChange", "url": "Anim.html#event_toChange", "type": "event"}, {"access": "", "host": "Anim", "name": "tween", "url": "Anim.html#event_tween", "type": "event"}]; |
|
171 </script> |
|
172 </body> |
|
173 </html> |