Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

51 rader
1.2 KiB

  1. /*
  2. * jQuery UI Effects Highlight 1.8
  3. *
  4. * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
  5. * Dual licensed under the MIT (MIT-LICENSE.txt)
  6. * and GPL (GPL-LICENSE.txt) licenses.
  7. *
  8. * http://docs.jquery.com/UI/Effects/Highlight
  9. *
  10. * Depends:
  11. * jquery.effects.core.js
  12. */
  13. (function($) {
  14. $.effects.highlight = function(o) {
  15. return this.queue(function() {
  16. var elem = $(this),
  17. props = ['backgroundImage', 'backgroundColor', 'opacity'],
  18. mode = $.effects.setMode(elem, o.options.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.options.color || '#ffff99'
  31. })
  32. .animate(animation, {
  33. queue: false,
  34. duration: o.duration,
  35. easing: o.options.easing,
  36. complete: function() {
  37. (mode == 'hide' && elem.hide());
  38. $.effects.restore(elem, props);
  39. (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter'));
  40. (o.callback && o.callback.apply(this, arguments));
  41. elem.dequeue();
  42. }
  43. });
  44. });
  45. };
  46. })(jQuery);