Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
if(!dojo._hasResource["dojox.fx.easing"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2
dojo._hasResource["dojox.fx.easing"] = true;
3
dojo.provide("dojox.fx.easing");
4
/*
5
	dojox.fx.easing is in this little file so you don't need dojox.fx to utilize this.
6
	dojox.fx has a lot of fun animations, but this module is optimized for size ...
7
 
8
*/
9
dojox.fx.easing = {
10
	// summary: Collection of easing functions to use beyond the default dojo._defaultEasing
11
	//
12
	// description:
13
	//	Easing functions are used to manipulate the iteration through
14
	//	an _Animation's _Line. _Line being the properties of an Animation,
15
	//	and the easing function progresses through that Line determing
16
	//	how quickly (or slowly) it should go.
17
	//
18
	//	example:
19
	//		dojo.require("dojox.fx.easing");
20
	//		var anim = dojo.fadeOut({
21
	//			node: 'node',
22
	//			duration: 2000,
23
	//			easing: dojox.fx.easing.easeIn
24
	//		}).play();
25
	//
26
	easeIn: function(/* Decimal? */n){
27
		// summary: an easing function that speeds an _Animation up closer to end
28
		return Math.pow(n, 3);
29
	},
30
 
31
	easeOut: function(/* Decimal? */n){
32
		// summary: an easing function that slows an _Animation down towards end
33
		return (1 - Math.pow(1-n,3));
34
	},
35
 
36
	easeInOut: function(/* Decimal? */n){
37
		// summary: an easing function that "humps" in the middle of an _Animation?
38
		return ((3 * Math.pow(n, 2)) - (2 * Math.pow(n, 3)))
39
	}
40
};
41
 
42
}