| 2150 |
mathias |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
|
2 |
"http://www.w3.org/TR/html4/strict.dtd">
|
|
|
3 |
<html>
|
|
|
4 |
<head>
|
|
|
5 |
<title>dojox.fx.easing functions:</title>
|
|
|
6 |
|
|
|
7 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true" ></script>
|
|
|
8 |
<style type="text/css">
|
|
|
9 |
@import "../../../dojo/resources/dojo.css";
|
|
|
10 |
@import "../../../dijit/themes/dijit.css";
|
|
|
11 |
@import "../../../dijit/themes/tundra/tundra.css";
|
|
|
12 |
@import "../../../dijit/tests/css/dijitTests.css";
|
|
|
13 |
|
|
|
14 |
.block {
|
|
|
15 |
width:200px;
|
|
|
16 |
height:100px;
|
|
|
17 |
background:#666;
|
|
|
18 |
border:1px solid #ccc;
|
|
|
19 |
display:block;
|
|
|
20 |
color:#fff;
|
|
|
21 |
text-align:center;
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
</style>
|
|
|
25 |
<script type="text/javascript">
|
|
|
26 |
dojo.require("dojo.fx"); // chain and combine should be in core :) (when they work)
|
|
|
27 |
dojo.require("dojox.fx.easing");
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
var allAnim = null;
|
|
|
31 |
dojo.addOnLoad(function(){
|
|
|
32 |
|
|
|
33 |
var easeInAnim = dojo.fx.chain([
|
|
|
34 |
dojo.fadeOut({
|
|
|
35 |
node: 'easeIn',
|
|
|
36 |
duration:2000,
|
|
|
37 |
easing: dojox.fx.easing.easeIn
|
|
|
38 |
}),
|
|
|
39 |
dojo.fadeIn({
|
|
|
40 |
node: 'easeIn',
|
|
|
41 |
duration:2000,
|
|
|
42 |
easing: dojox.fx.easing.easeIn
|
|
|
43 |
})
|
|
|
44 |
]);
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
var easeOutAnim = dojo.fx.chain([
|
|
|
48 |
dojo.fadeOut({
|
|
|
49 |
node: 'easeOut',
|
|
|
50 |
duration:2000,
|
|
|
51 |
easing: dojox.fx.easing.easeOut
|
|
|
52 |
}),
|
|
|
53 |
dojo.fadeIn({
|
|
|
54 |
node: 'easeOut',
|
|
|
55 |
duration:2000,
|
|
|
56 |
easing: dojox.fx.easing.easeOut
|
|
|
57 |
})
|
|
|
58 |
]);
|
|
|
59 |
|
|
|
60 |
var easeInOutAnim = dojo.fx.chain([
|
|
|
61 |
dojo.fadeOut({
|
|
|
62 |
node: 'easeInOut',
|
|
|
63 |
duration:2000,
|
|
|
64 |
easing: dojox.fx.easing.easeInOut
|
|
|
65 |
}),
|
|
|
66 |
dojo.fadeIn({
|
|
|
67 |
node: 'easeInOut',
|
|
|
68 |
duration:2000,
|
|
|
69 |
easing: dojox.fx.easing.easeInOut
|
|
|
70 |
})
|
|
|
71 |
]);
|
|
|
72 |
|
|
|
73 |
dojo.connect(dojo.byId('easeIn'),"onclick",easeInAnim,"play");
|
|
|
74 |
dojo.connect(dojo.byId('easeOut'),"onclick",easeOutAnim,"play");
|
|
|
75 |
dojo.connect(dojo.byId('easeInOut'),"onclick",easeInOutAnim,"play");
|
|
|
76 |
|
|
|
77 |
// argh! FIXME: combine and chain are destructive to the animations. :(
|
|
|
78 |
// allAnim = dojo.fx.combine([easeInAnim,easeOutAnim,easeInOutAnim]);
|
|
|
79 |
allAnim = { play: function(){
|
|
|
80 |
console.log("can't do this via fx.combine - destructive");
|
|
|
81 |
easeInAnim.play();
|
|
|
82 |
easeOutAnim.play();
|
|
|
83 |
easeInOutAnim.play();
|
|
|
84 |
}
|
|
|
85 |
};
|
|
|
86 |
|
|
|
87 |
}); // dojo.addOnLoad
|
|
|
88 |
</script>
|
|
|
89 |
</head>
|
|
|
90 |
<body class="tundra">
|
|
|
91 |
|
|
|
92 |
<h1 class="testTitle">dojox.fx.easing function tests:</h1>
|
|
|
93 |
|
|
|
94 |
(click block to play animation, or <a href="#" onclick="allAnim.play()">here to do all three</a>)
|
|
|
95 |
|
|
|
96 |
<div id="easeIn" class="block">dojox.fx.easing.easeIn</div>
|
|
|
97 |
<br><br>
|
|
|
98 |
<div id="easeOut" class="block">dojox.fx.easing.easeOut</div>
|
|
|
99 |
<br><br>
|
|
|
100 |
<div id="easeInOut" class="block">dojox.fx.easing.easeInOut</div>
|
|
|
101 |
|
|
|
102 |
<p>
|
|
|
103 |
dojox.fx.easing is stand-alone, and does not require the dojox.fx base files.
|
|
|
104 |
</p>
|
|
|
105 |
|
|
|
106 |
</body>
|
|
|
107 |
</html>
|