You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.2 KiB

1 year ago
  1. /*!
  2. * jQuery UI Effects Highlight 1.13.2
  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: Highlight Effect
  10. //>>group: Effects
  11. //>>description: Highlights the background of an element in a defined color for a custom duration.
  12. //>>docs: http://api.jqueryui.com/highlight-effect/
  13. //>>demos: http://jqueryui.com/effect/
  14. ( function( factory ) {
  15. "use strict";
  16. if ( typeof define === "function" && define.amd ) {
  17. // AMD. Register as an anonymous module.
  18. define( [
  19. "jquery",
  20. "./effect"
  21. ], factory );
  22. } else {
  23. // Browser globals
  24. factory( jQuery );
  25. }
  26. } )( function( $ ) {
  27. "use strict";
  28. return $.effects.define( "highlight", "show", function( options, done ) {
  29. var element = $( this ),
  30. animation = {
  31. backgroundColor: element.css( "backgroundColor" )
  32. };
  33. if ( options.mode === "hide" ) {
  34. animation.opacity = 0;
  35. }
  36. $.effects.saveStyle( element );
  37. element
  38. .css( {
  39. backgroundImage: "none",
  40. backgroundColor: options.color || "#ffff99"
  41. } )
  42. .animate( animation, {
  43. queue: false,
  44. duration: options.duration,
  45. easing: options.easing,
  46. complete: done
  47. } );
  48. } );
  49. } );