root / trunk / web / dojo / dojox / widget / rotator / Wipe.js
History | View | Annotate | Download (1.16 KB)
| 1 | 9 | andrej.cim | /*
|
|---|---|---|---|
| 2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
| 3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
| 4 | see: http://dojotoolkit.org/license for details
|
||
| 5 | */
|
||
| 6 | |||
| 7 | |||
| 8 | if(!dojo._hasResource["dojox.widget.rotator.Wipe"]){ |
||
| 9 | dojo._hasResource["dojox.widget.rotator.Wipe"]=true; |
||
| 10 | dojo.provide("dojox.widget.rotator.Wipe");
|
||
| 11 | (function(d){
|
||
| 12 | var _1=2,_2=3,UP=0,_3=1; |
||
| 13 | function _4(_5,w,h,x){ |
||
| 14 | var a=[0,w,0,0]; |
||
| 15 | if(_5==_2){
|
||
| 16 | a=[0,w,h,w];
|
||
| 17 | }else{
|
||
| 18 | if(_5==UP){
|
||
| 19 | a=[h,w,h,0];
|
||
| 20 | }else{
|
||
| 21 | if(_5==_3){
|
||
| 22 | a=[0,0,h,0]; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | } |
||
| 26 | if(x!=null){ |
||
| 27 | a[_5]=_5==_1||_5==_3?x:(_5%2?w:h)-x;
|
||
| 28 | } |
||
| 29 | return a;
|
||
| 30 | }; |
||
| 31 | function _6(n,_7,w,h,x){ |
||
| 32 | d.style(n,"clip",_7==null?"auto":"rect("+_4(_7,w,h,x).join("px,")+"px)"); |
||
| 33 | }; |
||
| 34 | function _8(_9,_a){ |
||
| 35 | var _b=_a.next.node,w=_a.rotatorBox.w,h=_a.rotatorBox.h;
|
||
| 36 | d.style(_b,{display:"",zIndex:(d.style(_a.current.node,"zIndex")||1)+1});
|
||
| 37 | _6(_b,_9,w,h); |
||
| 38 | return new d.Animation(d.mixin({node:_b,curve:[0,_9%2?w:h],onAnimate:function(x){ |
||
| 39 | _6(_b,_9,w,h,parseInt(x)); |
||
| 40 | }},_a)); |
||
| 41 | }; |
||
| 42 | d.mixin(dojox.widget.rotator,{wipeDown:function(_c){
|
||
| 43 | return _8(_1,_c);
|
||
| 44 | },wipeRight:function(_d){ |
||
| 45 | return _8(_2,_d);
|
||
| 46 | },wipeUp:function(_e){ |
||
| 47 | return _8(UP,_e);
|
||
| 48 | },wipeLeft:function(_f){ |
||
| 49 | return _8(_3,_f);
|
||
| 50 | }}); |
||
| 51 | })(dojo); |
||
| 52 | } |