2 * Portions of this file are based on pieces of Yahoo User Interface Library
3 * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
4 * YUI licensed under the BSD License:
5 * http://developer.yahoo.net/yui/license.txt
6 * <script type="text/javascript">
10 Roo.lib.Scroll = function(el, attributes, duration, method) {
12 Roo.lib.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
16 Roo.extend(Roo.lib.Scroll, Roo.lib.ColorAnim);
20 var superclass = Y.Scroll.superclass;
21 var proto = Y.Scroll.prototype;
23 proto.toString = function() {
24 var el = this.getEl();
25 var id = el.id || el.tagName;
26 return ("Scroll " + id);
29 proto.doMethod = function(attr, start, end) {
32 if (attr == 'scroll') {
34 this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames),
35 this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames)
39 val = superclass.doMethod.call(this, attr, start, end);
44 proto.getAttribute = function(attr) {
46 var el = this.getEl();
48 if (attr == 'scroll') {
49 val = [ el.scrollLeft, el.scrollTop ];
51 val = superclass.getAttribute.call(this, attr);
57 proto.setAttribute = function(attr, val, unit) {
58 var el = this.getEl();
60 if (attr == 'scroll') {
61 el.scrollLeft = val[0];
62 el.scrollTop = val[1];
64 superclass.setAttribute.call(this, attr, val, unit);