~launchpad-pqm/lazr-js/toolchain

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/anim/anim-scroll-debug.js

  • Committer: Sidnei da Silva
  • Date: 2009-11-16 00:51:29 UTC
  • mto: This revision was merged to the branch mainline in revision 154.
  • Revision ID: sidnei.da.silva@canonical.com-20091116005129-8ibwjlboa38glaw5
- Improved generation of skin modules and revamped combo service to make it more twisty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
 
Code licensed under the BSD License:
4
 
http://developer.yahoo.com/yui/license.html
5
 
version: 3.2.0
6
 
build: 2676
7
 
*/
8
 
YUI.add('anim-scroll', function(Y) {
9
 
 
10
 
/**
11
 
 * Adds support for the <code>scroll</code> property in <code>to</code>
12
 
 * and <code>from</code> attributes.
13
 
 * @module anim
14
 
 * @submodule anim-scroll
15
 
 */
16
 
 
17
 
var NUM = Number;
18
 
 
19
 
//TODO: deprecate for scrollTop/Left properties?
20
 
Y.Anim.behaviors.scroll = {
21
 
    set: function(anim, att, from, to, elapsed, duration, fn) {
22
 
        var
23
 
            node = anim._node, 
24
 
            val = ([
25
 
            fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
26
 
            fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
27
 
        ]);
28
 
 
29
 
        if (val[0]) {
30
 
            node.set('scrollLeft', val[0]);
31
 
        }
32
 
 
33
 
        if (val[1]) {
34
 
            node.set('scrollTop', val[1]);
35
 
        }
36
 
    },
37
 
    get: function(anim) {
38
 
        var node = anim._node;
39
 
        return [node.get('scrollLeft'), node.get('scrollTop')];
40
 
    }
41
 
};
42
 
 
43
 
 
44
 
 
45
 
}, '3.2.0' ,{requires:['anim-base']});