Fade.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // wrapped by build app
  2. define("dojox/widget/rotator/Fade", ["dijit","dojo","dojox","dojo/require!dojo/fx"], function(dijit,dojo,dojox){
  3. dojo.provide("dojox.widget.rotator.Fade");
  4. dojo.require("dojo.fx");
  5. (function(d){
  6. function _fade(/*Object*/args, /*string*/action){
  7. // summary:
  8. // Returns an animation of a fade out and fade in of the current and next
  9. // panes. It will either chain (fade) or combine (crossFade) the fade
  10. // animations.
  11. var n = args.next.node;
  12. d.style(n, {
  13. display: "",
  14. opacity: 0
  15. });
  16. args.node = args.current.node;
  17. return d.fx[action]([ /*dojo.Animation*/
  18. d.fadeOut(args),
  19. d.fadeIn(d.mixin(args, { node: n }))
  20. ]);
  21. }
  22. d.mixin(dojox.widget.rotator, {
  23. fade: function(/*Object*/args){
  24. // summary:
  25. // Returns a dojo.Animation that fades out the current pane, then fades in
  26. // the next pane.
  27. return _fade(args, "chain"); /*dojo.Animation*/
  28. },
  29. crossFade: function(/*Object*/args){
  30. // summary:
  31. // Returns a dojo.Animation that cross fades two rotator panes.
  32. return _fade(args, "combine"); /*dojo.Animation*/
  33. }
  34. });
  35. })(dojo);
  36. });