1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
6 <title>skeleton page | The Dojo Toolkit</title>
8 <style type="text/css">
9 @import "../../../dijit/themes/tundra/tundra.css";
14 font:11pt Arial,sans-serif;
24 border:2px solid #ededed;
33 background:#fff url('images/averycutedog.jpg') no-repeat center center;
34 border:2px solid #f0f0f0;
59 .even { margin-left:1px; }
65 font:8pt Arial,sans-serif;
81 <script type="text/javascript" src="../../../dojo/dojo.js"
82 djConfig="parseOnLoad:true, isDebug:true"></script>
84 <script type="text/javascript">
85 dojo.require("dijit.form.Button"); // for the tests
88 dojo.require("dojo.fx");
90 // provides dojo.query() animations:
91 dojo.require("dojo.NodeList-fx");
92 dojo.require("dojox.fx.ext-dojo.NodeList");
94 // core dojox package:
95 dojo.require("dojox.fx");
96 dojo.require("dojox.fx._core"); // _Line
99 dojo.require("dojox.fx.style");
100 dojo.require("dojox.fx.easing");
103 dojo.require("dojox.widget.FisheyeLite");
107 <body class="tundra">
110 <h2>Dojo FX: base animations</h2>
112 <button dojoType="dijit.form.Button">
114 <script type="dojo/method" event="onClick">
115 dojo.fadeOut({ node:"testSlide",
117 dojo.fadeIn({ node:"testSlide", delay:300 }).play();
123 <button dojoType="dijit.form.Button">
124 animateProperty: height
125 <script type="dojo/method" event="onClick">
126 dojo.animateProperty({
128 properties:{ height:{ end:1, unit:"px" } },
130 dojo.animateProperty({
133 properties:{ height:{ end:175, unit:"px" } }
140 <button dojoType="dijit.form.Button">
141 animateProperty: width
142 <script type="dojo/method" event="onClick">
143 dojo.animateProperty({
145 properties:{ width:{ end:1, unit:"px" } },
147 dojo.animateProperty({
150 properties:{ width:{ end:175, unit:"px" } }
157 <div class="testBox" id="testSlideWrapper">
158 <div class="testItem" id="testSlide">
159 <div class="trick"> </div>
164 <h2>Animate CSS Properties:</h2>
166 <button dojoType="dijit.form.Button">
168 <script type="dojo/method" event="onClick">
169 dojo.animateProperty({
172 marginLeft:{ end:322, unit:"px", start:1 }
175 dojo.animateProperty({
178 marginLeft:{ end:1, start:322, unit:"px" }
187 <button dojoType="dijit.form.Button">
189 <script type="dojo/method" event="onClick">
190 dojo.animateProperty({
194 end: dojo.marginBox("cssNodeWrap").w - 195,
197 paddingTop:{ end:17, unit:"px", start:4 }
200 dojo.animateProperty({
203 paddingTop:{ end:4, start:17, unit:"px" },
204 left: { end: 10, unit:"px" }
213 <button dojoType="dijit.form.Button">
215 <script type="dojo/method" event="onClick">
216 dojo.animateProperty({
219 width: { end:700, unit:"px", start:175 },
220 fontSize:{ end:21, unit:"pt", start:11 }
223 dojo.animateProperty({
226 width: { end:175, unit:"px" },
227 fontSize:{ end:11, start:21, unit:"pt" }
236 <div class="testBox" id="cssNodeWrap">
238 <p id="lorem">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
239 Nam facilisis enim. Pellentesque in elit et lacus euismod dignissim.
240 Aliquam dolor pede, convallis eget, dictum a, blandit ac, urna.
241 Pellentesque sed nunc ut justo volutpat egestas. Class aptent taciti
242 sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos.
248 <h2>dojo.fx - Core animations</h2>
250 <button dojoType="dijit.form.Button">
252 <script type="dojo/method" event="onClick">
253 // we're 175px, slide to containerWidth - 195
254 var left = dojo.marginBox("testSlideWrapper").w - 195;
255 // make and play the animation
262 dojo.fx.slideTo({ top:10, left:10, node:"testSlideToo" }).play();
268 <button dojoType="dijit.form.Button">
270 <script type="dojo/method" event="onClick">
271 var anim1 = dojo.fx.slideTo({
273 left: dojo.marginBox("testSlideWrapper").w - 195,
274 node: "testSlideToo",
277 dojo.fx.slideTo({ top:10, left:10, node:"testSlideToo" }).play();
280 var anim2 = dojo.fadeOut({
281 node: "testSlideToo",
283 // we could switch out the backgroundImage property here.
284 dojo.fadeIn({ node:"testSlideToo" }).play();
287 var combined = dojo.fx.combine([anim1,anim2]);
292 <button dojoType="dijit.form.Button">
294 <script type="dojo/method" event="onClick">
295 var anim1 = dojo.fadeOut({ node:"testSlideToo",
296 // so anim1 is over, making this onEnd and anim2 basically
297 // a combine() (depending on the duration: )
300 dojo.fadeIn({ node:'testSlideToo' }).play(delay);
304 var anim2 = dojo.animateProperty({
308 end: dojo.marginBox("testSlideTooWrap").w - 195,
313 dojo.fx.slideTo({ node:"testSlideToo", top:10, left:10 }).play(123);
316 dojo.fx.chain([anim1,anim2]).play();
320 <div class="testBox" id="testSlideTooWrap">
321 <div class="testItem" id="testSlideToo">
322 <div class="trick"></div>
326 <h2>dojo.query FX</h2>
328 <button dojoType="dijit.form.Button">
330 <script type="dojo/method" event="onClick">
331 dojo.query(".even","queryUl").fadeOut({
333 dojo.query(".even","queryUl").fadeIn({ delay: 300 }).play();
339 <button dojoType="dijit.form.Button">
341 <script type="dojo/method" event="onClick">
342 dojo.query(".odd","queryUl").fadeOut({
344 dojo.query(".odd","queryUl").fadeIn({ delay: 300 }).play();
350 <button dojoType="dijit.form.Button">
352 <script type="dojo/method" event="onClick">
353 dojo.query(".odd","queryUl").animateProperty({
355 marginLeft:{ end:34, unit:"px" }
359 dojo.query(".odd","queryUl").animateProperty({
362 marginLeft:{ end:1, unit:"px" }
370 <button dojoType="dijit.form.Button">
372 <script type="dojo/method" event="onClick">
373 dojo.query(".odd","queryUl").animateProperty({
374 easing:dojox.fx.easing.backOut,
376 marginLeft:{ end:34, unit:"px" }
380 dojo.query(".odd","queryUl").animateProperty({
383 easing:dojox.fx.easing.bounceOut,
385 marginLeft:{ end:1, unit:"px" }
393 <button dojoType="dijit.form.Button">
395 <script type="dojo/method" event="onClick">
396 this.setAttribute("disabled",true);
397 dojo.query("li","fisheyeList").forEach(function(n){
398 new dojox.widget.FisheyeLite({
404 dojo.byId("clickAlert").innerHTML = "clicked: " + this.id;
406 easeIn:dojox.fx.easing.elasticOut,
409 }).style("cursor","pointer");
413 <div class="testBox" id="queryParent">
415 <li class="odd">odd row</li>
416 <li class="even">even row</li>
417 <li class="odd">odd row</li>
418 <li class="even">even row</li>
419 <li class="odd">odd row</li>
420 <li class="even">even row</li>
421 <li class="odd">odd row</li>
422 <li class="even">even row</li>
423 <li class="odd">odd row</li>
425 <div class="altItem">
426 <p>(FisheyeLite makes this easy. be creative:)</p>
427 <ul id="fisheyeList">
428 <li class="odd">odd row</li>
429 <li class="even">even row</li>
430 <li class="odd">odd row</li>
431 <li class="even">even row</li>
432 <li class="odd">odd row</li>
433 <li class="even" id="testIdFish">with id</li>
434 <li class="odd">odd row</li>
436 <p id="clickAlert"></p>