NodeList.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. if(!dojo._hasResource["dojox.fx.ext-dojo.NodeList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
  7. dojo._hasResource["dojox.fx.ext-dojo.NodeList"] = true;
  8. dojo.provide("dojox.fx.ext-dojo.NodeList");
  9. dojo.experimental("dojox.fx.ext-dojo.NodeList");
  10. // summary: Core extensions to dojo.NodeList providing addtional fx to dojo.NodeList-fx
  11. // description:
  12. // A Package to extend dojo base NodeList with fx provided by the dojox.fx project.
  13. // These are experimental animations, in an experimental
  14. dojo.require("dojo.NodeList-fx");
  15. dojo.require("dojox.fx");
  16. dojo.extend(dojo.NodeList, {
  17. sizeTo: function(args){
  18. // summary:
  19. // size all elements of this NodeList. Returns an instance of dojo.Animation
  20. // example:
  21. // | // size all divs with class "blah"
  22. // | dojo.query("div.blah").sizeTo({
  23. // | width:50,
  24. // | height:50
  25. // | }).play();
  26. return this._anim(dojox.fx, "sizeTo", args); // dojo.Animation
  27. },
  28. slideBy: function(args){
  29. // summary:
  30. // slide all elements of this NodeList. Returns an instance of dojo.Animation
  31. //
  32. // example:
  33. // | // slide all tables with class "blah" 10 px
  34. // | dojo.query("table.blah").slideBy({ top:10, left:10 }).play();
  35. return this._anim(dojox.fx, "slideBy", args); // dojo.Animation
  36. },
  37. highlight: function(args){
  38. // summary:
  39. // highlight all elements of the node list.
  40. // Returns an instance of dojo.Animation
  41. // example:
  42. // | // highlight all links with class "foo"
  43. // | dojo.query("a.foo").hightlight().play();
  44. return this._anim(dojox.fx, "highlight", args); // dojo.Animation
  45. },
  46. fadeTo: function(args){
  47. // summary:
  48. // fade all elements of the node list to a specified opacity
  49. // example:
  50. // | // fade all elements with class "bar" to to 50% opacity
  51. // | dojo.query(".bar").fadeTo({ end: 0.5 }).play();
  52. return this._anim(dojo,"_fade",args);
  53. },
  54. wipeTo: function(args){
  55. // summary:
  56. // Wipe all elements of the NodeList to a specified width: or height:
  57. // example:
  58. // | dojo.query(".box").wipeTo({ width: 300px }).play();
  59. return this._anim(dojox.fx, "wipeTo", args);
  60. }
  61. });
  62. }