effect-fade.js 733 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*!
  2. * jQuery UI Effects Fade 1.11.4
  3. * http://jqueryui.com
  4. *
  5. * Copyright jQuery Foundation and other contributors
  6. * Released under the MIT license.
  7. * http://jquery.org/license
  8. *
  9. * http://api.jqueryui.com/fade-effect/
  10. */
  11. (function( factory ) {
  12. if ( typeof define === "function" && define.amd ) {
  13. // AMD. Register as an anonymous module.
  14. define([
  15. "jquery",
  16. "./effect"
  17. ], factory );
  18. } else {
  19. // Browser globals
  20. factory( jQuery );
  21. }
  22. }(function( $ ) {
  23. return $.effects.effect.fade = function( o, done ) {
  24. var el = $( this ),
  25. mode = $.effects.setMode( el, o.mode || "toggle" );
  26. el.animate({
  27. opacity: mode
  28. }, {
  29. queue: false,
  30. duration: o.duration,
  31. easing: o.easing,
  32. complete: done
  33. });
  34. };
  35. }));