source: cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/api/anim-scroll.js.html @ 5259

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/branches/cows-vis/cows/pylons/project_templates/cows_server/+package+/public/js/yui/api/anim-scroll.js.html@5259
Revision 5259, 9.2 KB checked in by domlowe, 11 years ago (diff)

adding yui javascript

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4        <title>API: anim   anim-scroll.js  (YUI Library)</title>
5        <link rel="stylesheet" type="text/css" href="assets/api.css">
6    <script type="text/javascript" src="assets/api-js"></script>
7    <script type="text/javascript" src="assets/ac-js"></script>
8</head>
9
10<body id="yahoo-com">
11
12<div id="doc3" class="yui-t2">
13
14        <div id="hd">
15        <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
16        <h3>anim&nbsp; <span class="subtitle">3.0.0pr1</span></h3>
17        <p>
18        <a href="./index.html">Yahoo! UI Library</a> 
19            &gt; <a href="./module_anim.html">anim</a>
20               
21                 &gt; anim-scroll.js (source view)
22            </p>
23
24
25        </div>
26
27        <div id="bd">
28                <div id="yui-main">
29                        <div class="yui-b">
30            <form name="yui-classopts-form">
31    <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> <label for="showprivate">Show Private</label></span>
32    <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> <label for="showprotected">Show Protected</label></span>
33    <span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> <label for="showdeprecated">Show Deprecated</label></span>
34            </form>
35
36                    <div id="srcout">
37                        <style>
38                            #doc3 #classopts { display:none; }
39                        </style>
40<div class="highlight" ><pre><span class="c">/**</span>
41<span class="c"> * Adds support for the &lt;code&gt;scroll&lt;/code&gt; property in &lt;code&gt;to&lt;/code&gt;</span>
42<span class="c"> * and &lt;code&gt;from&lt;/code&gt; attributes.</span>
43<span class="c"> * @module anim</span>
44<span class="c"> * @submodule anim-scroll</span>
45<span class="c"> * @for Anim</span>
46<span class="c"> */</span>
47
48<span class="k">var</span> <span class="nx">NUM</span> <span class="o">=</span> <span class="nb">Number</span><span class="o">;</span>
49
50<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>
51    <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>
52        <span class="k">var</span>
53            <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> 
54            <span class="nx">val</span> <span class="o">=</span> <span class="o">([</span>
55            <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>
56            <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>
57        <span class="o">]);</span>
58
59        <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>
60            <span class="nx">node</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;scrollLeft&#39;</span><span class="o">,</span> <span class="nx">val</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
61        <span class="o">}</span>
62
63        <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>
64            <span class="nx">node</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;scrollTop&#39;</span><span class="o">,</span> <span class="nx">val</span><span class="o">[</span><span class="m">1</span><span class="o">]);</span>
65        <span class="o">}</span>
66    <span class="o">},</span>
67    <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>
68        <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>
69        <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">&#39;scrollLeft&#39;</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">&#39;scrollTop&#39;</span><span class="o">)];</span>
70    <span class="o">}</span>
71<span class="o">};</span>
72</pre></div>
73                    </div>
74                        </div>
75                </div>
76                <div class="yui-b">
77            <div class="nav">
78
79                    <div class="module">
80                        <h4>Modules</h4>
81                        <ul class="content">
82
83                                <li class="selected"><a href="module_anim.html">anim</a></li>
84
85                                <li class=""><a href="module_attribute.html">attribute</a></li>
86
87                                <li class=""><a href="module_base.html">base</a></li>
88
89                                <li class=""><a href="module_cookie.html">cookie</a></li>
90
91                                <li class=""><a href="module_dd.html">dd</a></li>
92
93                                <li class=""><a href="module_dd-plugin.html">dd-plugin</a></li>
94
95                                <li class=""><a href="module_dom.html">dom</a></li>
96
97                                <li class=""><a href="module_dump.html">dump</a></li>
98
99                                <li class=""><a href="module_event.html">event</a></li>
100
101                                <li class=""><a href="module_io.html">io</a></li>
102
103                                <li class=""><a href="module_json.html">json</a></li>
104
105                                <li class=""><a href="module_node.html">node</a></li>
106
107                                <li class=""><a href="module_oop.html">oop</a></li>
108
109                                <li class=""><a href="module_queue.html">queue</a></li>
110
111                                <li class=""><a href="module_substitute.html">substitute</a></li>
112
113                                <li class=""><a href="module_yui.html">yui</a></li>
114                        </ul>
115                    </div>
116
117                    <div class="module">
118                        <h4>Classes</h4>
119                        <ul class="content">
120                                <li class=""><a href="Anim.html">Anim</a></li>
121                                <li class=""><a href="Easing.html">Easing</a></li>
122                        </ul>
123                    </div>
124
125                    <div class="module">
126                        <h4>Files</h4>
127                        <ul class="content">       
128                                <li class=""><a href="anim-color.js.html">anim-color.js</a></li>
129                                <li class=""><a href="anim-curve.js.html">anim-curve.js</a></li>
130                                <li class=""><a href="anim-easing.js.html">anim-easing.js</a></li>
131                                <li class=""><a href="anim-node-plugin.js.html">anim-node-plugin.js</a></li>
132                                <li class="selected"><a href="anim-scroll.js.html">anim-scroll.js</a></li>
133                                <li class=""><a href="anim-xy.js.html">anim-xy.js</a></li>
134                                <li class=""><a href="anim.js.html">anim.js</a></li>
135                        </ul>
136                    </div>
137
138
139
140
141
142            </div>
143                </div>
144        </div>
145        <div id="ft">
146        <hr />
147        Copyright &copy; 2008 Yahoo! Inc. All rights reserved.
148        </div>
149</div>
150</body>
151</html>
Note: See TracBrowser for help on using the repository browser.