NodeList.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. define("dojox/fx/ext-dojo/NodeList", ["dojo/_base/kernel", "dojo/_base/lang", "dojo/_base/fx", "dojox/fx","dojo/NodeList-fx"],
  2. function(kernel, lang, baseFx, CoreFx, NodeList){
  3. kernel.experimental("dojox.fx.ext-dojo.NodeList");
  4. // summary: Core extensions to dojo.NodeList providing addtional fx to dojo.NodeList-fx
  5. // description:
  6. // A Package to extend dojo base NodeList with fx provided by the dojox.fx project.
  7. // These are experimental animations, in an experimental
  8. lang.extend(NodeList, {
  9. sizeTo: function(args){
  10. // summary:
  11. // size all elements of this NodeList. Returns an instance of dojo.Animation
  12. // example:
  13. // | // size all divs with class "blah"
  14. // | dojo.query("div.blah").sizeTo({
  15. // | width:50,
  16. // | height:50
  17. // | }).play();
  18. return this._anim(CoreFx, "sizeTo", args); // dojo.Animation
  19. },
  20. slideBy: function(args){
  21. // summary:
  22. // slide all elements of this NodeList. Returns an instance of dojo.Animation
  23. //
  24. // example:
  25. // | // slide all tables with class "blah" 10 px
  26. // | dojo.query("table.blah").slideBy({ top:10, left:10 }).play();
  27. return this._anim(CoreFx, "slideBy", args); // dojo.Animation
  28. },
  29. highlight: function(args){
  30. // summary:
  31. // highlight all elements of the node list.
  32. // Returns an instance of dojo.Animation
  33. // example:
  34. // | // highlight all links with class "foo"
  35. // | dojo.query("a.foo").hightlight().play();
  36. return this._anim(CoreFx, "highlight", args); // dojo.Animation
  37. },
  38. fadeTo: function(args){
  39. // summary:
  40. // fade all elements of the node list to a specified opacity
  41. // example:
  42. // | // fade all elements with class "bar" to to 50% opacity
  43. // | dojo.query(".bar").fadeTo({ end: 0.5 }).play();
  44. return this._anim(baseFx,"_fade",args);
  45. },
  46. wipeTo: function(args){
  47. // summary:
  48. // Wipe all elements of the NodeList to a specified width: or height:
  49. // example:
  50. // | dojo.query(".box").wipeTo({ width: 300px }).play();
  51. return this._anim(CoreFx, "wipeTo", args);
  52. }
  53. });
  54. return NodeList;
  55. });