暂无描述

effect-fade.js 916B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*!
  2. * jQuery UI Effects Fade 1.12.1
  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. //>>label: Fade Effect
  10. //>>group: Effects
  11. //>>description: Fades the element.
  12. //>>docs: http://api.jqueryui.com/fade-effect/
  13. //>>demos: http://jqueryui.com/effect/
  14. ( function( factory ) {
  15. if ( typeof define === "function" && define.amd ) {
  16. // AMD. Register as an anonymous module.
  17. define( [
  18. "jquery",
  19. "./effect"
  20. ], factory );
  21. } else {
  22. // Browser globals
  23. factory( jQuery );
  24. }
  25. }( function( $ ) {
  26. return $.effects.define( "fade", "toggle", function( options, done ) {
  27. var show = options.mode === "show";
  28. $( this )
  29. .css( "opacity", show ? 0 : 1 )
  30. .animate( {
  31. opacity: show ? 1 : 0
  32. }, {
  33. queue: false,
  34. duration: options.duration,
  35. easing: options.easing,
  36. complete: done
  37. } );
  38. } );
  39. } ) );