Previous topic

dojo.NodeList

Next topic

dojo._Url

This Page

dojo.NodeList-fxΒΆ

Status:Draft
Version:1.2

This module incorporates dojo.fx functionality into dojo.query by extending the dojo.NodeList Class.

The first most important thing to do is require the module into your page:

dojo.require("dojo.NodeList-fx");

To use your newly created functions in NodeList, issue a dojo.query() call:

<button id="fadebutton">Fade Them Out</button>
<div id="fadebuttontarget">
   <li class="thinger">Item One</li>
   <li class="thinger">Item Two</li>
</div>
<script type="text/javascript">
   dojo.require("dojo.NodeList-fx");
   dojo.addOnLoad(function(){
       dojo.query("#fadebutton").onclick(function(){
           dojo.query("#fadebuttontarget li").fadeOut().play();
       });
   });
</script>

The most important thing to note is NodeList animations return an instance of a dojo._Animation, the foundation for all Dojo FX. This prevents further chaining, as you have to explicitly call .play() on the returned animation.

The parameters you can specify to each animation provided are identical to their dojo.fx counterparts, omitting the node: parameter, as each node in the NodeList is passed for you.

There are more NodeList animations provided by the dojox.fx.ext-dojo.NodeList module, in the dojox.fx project.