Skip to main content

Search and Top Navigation

Ticket #4416: effects.fade.js


File effects.fade.js, 0.6 KB (added by dohsun, March 30, 2009 11:06PM UTC)
/*
 * jQuery UI fade effect, based on pulsate
 *
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Depends:
 *	effects.core.js
 */
(function($) {

$.effects.fade = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this);

		// Set options
		var speed = o.options.speed || 230;
		var mode = o.options.mode || 'show'; // Set Mode

		// Animate
		if (mode == 'show') {
			el.fadeIn(speed);
		} else {
			el.fadeOut(speed);
		};
		el.queue('fx', function() { el.dequeue(); });
		el.dequeue();
	});
};

})(jQuery);

Download in other formats:

Original Format