2009-11-13 04:35:47 +00:00
|
|
|
/*
|
|
|
|
* jQuery UI Effects Fade @VERSION
|
|
|
|
*
|
2011-01-17 14:13:18 +00:00
|
|
|
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
2010-07-09 13:01:04 +00:00
|
|
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
|
|
* http://jquery.org/license
|
2009-11-13 04:35:47 +00:00
|
|
|
*
|
|
|
|
* http://docs.jquery.com/UI/Effects/Fade
|
|
|
|
*
|
|
|
|
* Depends:
|
|
|
|
* jquery.effects.core.js
|
|
|
|
*/
|
2010-07-13 13:57:58 +00:00
|
|
|
(function( $, undefined ) {
|
2009-11-13 04:35:47 +00:00
|
|
|
|
2011-03-15 13:00:45 +00:00
|
|
|
$.effects.effect.fade = function( o ) {
|
2011-05-01 11:24:22 +00:00
|
|
|
return this.queue( function( next ) {
|
2011-03-06 21:24:24 +00:00
|
|
|
var el = $( this ),
|
2011-05-01 11:24:22 +00:00
|
|
|
mode = $.effects.setMode( el, o.mode || 'toggle' ),
|
|
|
|
hide = mode === "hide";
|
2009-11-13 04:35:47 +00:00
|
|
|
|
2011-05-01 11:24:22 +00:00
|
|
|
el.show();
|
2011-03-06 21:24:24 +00:00
|
|
|
el.animate({
|
2011-05-01 11:24:22 +00:00
|
|
|
opacity: hide ? 0 : 1
|
2011-03-06 21:24:24 +00:00
|
|
|
}, {
|
2009-11-13 04:35:47 +00:00
|
|
|
queue: false,
|
|
|
|
duration: o.duration,
|
2011-03-06 21:24:24 +00:00
|
|
|
easing: o.easing,
|
2009-11-13 04:35:47 +00:00
|
|
|
complete: function() {
|
2011-05-01 11:24:22 +00:00
|
|
|
if ( hide ) {
|
|
|
|
el.hide();
|
|
|
|
}
|
|
|
|
if ( o.complete ) {
|
|
|
|
o.complete.call( this );
|
|
|
|
}
|
|
|
|
next();
|
2009-11-13 04:35:47 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
})(jQuery);
|