jquery.ui.effect-highlight.js 1007B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*!
  2. * jQuery UI Effects Highlight v1.9 stable
  3. * http://jqueryui.com
  4. *
  5. * Copyright 2012 jQuery Foundation and other contributors
  6. * Released under the MIT license.
  7. * http://jquery.org/license
  8. *
  9. * http://api.jqueryui.com/highlight-effect/
  10. *
  11. * Depends:
  12. * jquery.ui.effect.js
  13. */
  14. (function( $, undefined ) {
  15. $.effects.effect.highlight = function( o, done ) {
  16. var elem = $( this ),
  17. props = [ "backgroundImage", "backgroundColor", "opacity" ],
  18. mode = $.effects.setMode( elem, o.mode || "show" ),
  19. animation = {
  20. backgroundColor: elem.css( "backgroundColor" )
  21. };
  22. if (mode === "hide") {
  23. animation.opacity = 0;
  24. }
  25. $.effects.save( elem, props );
  26. elem
  27. .show()
  28. .css({
  29. backgroundImage: "none",
  30. backgroundColor: o.color || "#ffff99"
  31. })
  32. .animate( animation, {
  33. queue: false,
  34. duration: o.duration,
  35. easing: o.easing,
  36. complete: function() {
  37. if ( mode === "hide" ) {
  38. elem.hide();
  39. }
  40. $.effects.restore( elem, props );
  41. done();
  42. }
  43. });
  44. };
  45. })(jQuery);