client/player/res/js/ui/jquery.effects.highlight.js
author ymh <ymh.work@gmail.com>
Fri, 06 Aug 2010 16:29:21 +0200
changeset 30 2f27e07f9974
parent 29 client/player/res.new/js/ui/jquery.effects.highlight.js@d969ba10156c
permissions -rw-r--r--
lowercase folder names
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     1
/*
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     2
 * jQuery UI Effects Highlight 1.8.1
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     3
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     4
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     5
 * Dual licensed under the MIT (MIT-LICENSE.txt)
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     6
 * and GPL (GPL-LICENSE.txt) licenses.
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     7
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     8
 * http://docs.jquery.com/UI/Effects/Highlight
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
     9
 *
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    10
 * Depends:
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    11
 *	jquery.effects.core.js
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    12
 */
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    13
(function($) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    14
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    15
$.effects.highlight = function(o) {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    16
	return this.queue(function() {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    17
		var elem = $(this),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    18
			props = ['backgroundImage', 'backgroundColor', 'opacity'],
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    19
			mode = $.effects.setMode(elem, o.options.mode || 'show'),
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    20
			animation = {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    21
				backgroundColor: elem.css('backgroundColor')
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    22
			};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    23
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    24
		if (mode == 'hide') {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    25
			animation.opacity = 0;
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    26
		}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    27
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    28
		$.effects.save(elem, props);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    29
		elem
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    30
			.show()
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    31
			.css({
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    32
				backgroundImage: 'none',
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    33
				backgroundColor: o.options.color || '#ffff99'
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    34
			})
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    35
			.animate(animation, {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    36
				queue: false,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    37
				duration: o.duration,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    38
				easing: o.options.easing,
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    39
				complete: function() {
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    40
					(mode == 'hide' && elem.hide());
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    41
					$.effects.restore(elem, props);
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    42
					(mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter'));
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    43
					(o.callback && o.callback.apply(this, arguments));
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    44
					elem.dequeue();
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    45
				}
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    46
			});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    47
	});
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    48
};
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    49
44c6b827825d Commit new player (version radio) with new path organisation
hurons
parents:
diff changeset
    50
})(jQuery);