root / trunk / web / dojo / dojox / widget / FisheyeLite.js
History | View | Annotate | Download (1.71 KB)
1 |
/*
|
---|---|
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.FisheyeLite"]){ |
9 |
dojo._hasResource["dojox.widget.FisheyeLite"]=true; |
10 |
dojo.provide("dojox.widget.FisheyeLite");
|
11 |
dojo.experimental("dojox.widget.FisheyeLite");
|
12 |
dojo.require("dijit._Widget");
|
13 |
dojo.require("dojo.fx.easing");
|
14 |
dojo.declare("dojox.widget.FisheyeLite",dijit._Widget,{durationIn:350,easeIn:dojo.fx.easing.backOut,durationOut:1420,easeOut:dojo.fx.easing.elasticOut,properties:null,units:"px",constructor:function(_1,_2){ |
15 |
this.properties=_1.properties||{fontSize:2.75}; |
16 |
},postCreate:function(){ |
17 |
this.inherited(arguments); |
18 |
this._target=dojo.query(".fisheyeTarget",this.domNode)[0]||this.domNode; |
19 |
this._makeAnims();
|
20 |
this.connect(this.domNode,"onmouseover","show"); |
21 |
this.connect(this.domNode,"onmouseout","hide"); |
22 |
this.connect(this._target,"onclick","onClick"); |
23 |
},show:function(){ |
24 |
this._runningOut.stop();
|
25 |
this._runningIn.play();
|
26 |
},hide:function(){ |
27 |
this._runningIn.stop();
|
28 |
this._runningOut.play();
|
29 |
},_makeAnims:function(){ |
30 |
var _3={},_4={},cs=dojo.getComputedStyle(this._target); |
31 |
for(var p in this.properties){ |
32 |
var _5=this.properties[p],_6=dojo.isObject(_5),v=parseInt(cs[p]); |
33 |
_4[p]={end:v,units:this.units}; |
34 |
_3[p]=_6?_5:{end:_5*v,units:this.units}; |
35 |
} |
36 |
this._runningIn=dojo.animateProperty({node:this._target,easing:this.easeIn,duration:this.durationIn,properties:_3}); |
37 |
this._runningOut=dojo.animateProperty({node:this._target,duration:this.durationOut,easing:this.easeOut,properties:_4}); |
38 |
this.connect(this._runningIn,"onEnd",dojo.hitch(this,"onSelected",this)); |
39 |
},onClick:function(e){ |
40 |
},onSelected:function(e){ |
41 |
}}); |
42 |
} |