Нет описания

effect-highlight.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*!
  2. * jQuery UI Effects Highlight 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: 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. 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( "highlight", "show", function( options, done ) {
  27. var element = $( this ),
  28. animation = {
  29. backgroundColor: element.css( "backgroundColor" )
  30. };
  31. if ( options.mode === "hide" ) {
  32. animation.opacity = 0;
  33. }
  34. $.effects.saveStyle( element );
  35. element
  36. .css( {
  37. backgroundImage: "none",
  38. backgroundColor: options.color || "#ffff99"
  39. } )
  40. .animate( animation, {
  41. queue: false,
  42. duration: options.duration,
  43. easing: options.easing,
  44. complete: done
  45. } );
  46. } );
  47. } ) );