initial import
[roojs1] / Roo / lib / Anim.js
1 /*
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">
7  *
8  */
9  
10 (function() {   
11
12     Roo.lib.Anim = {
13         scroll : function(el, args, duration, easing, cb, scope) {
14             this.run(el, args, duration, easing, cb, scope, Roo.lib.Scroll);
15         },
16
17         motion : function(el, args, duration, easing, cb, scope) {
18             this.run(el, args, duration, easing, cb, scope, Roo.lib.Motion);
19         },
20
21         color : function(el, args, duration, easing, cb, scope) {
22             this.run(el, args, duration, easing, cb, scope, Roo.lib.ColorAnim);
23         },
24
25         run : function(el, args, duration, easing, cb, scope, type) {
26             type = type || Roo.lib.AnimBase;
27             if (typeof easing == "string") {
28                 easing = Roo.lib.Easing[easing];
29             }
30             var anim = new type(el, args, duration, easing);
31             anim.animateX(function() {
32                 Roo.callback(cb, scope);
33             });
34             return anim;
35         }
36     };
37 })();