equal
deleted
inserted
replaced
|
1 /*! |
|
2 * jQuery UI Effects Fade 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 |
|
10 //>>label: Fade Effect |
|
11 //>>group: Effects |
|
12 //>>description: Fades the element. |
|
13 //>>docs: http://api.jqueryui.com/fade-effect/ |
|
14 //>>demos: http://jqueryui.com/effect/ |
|
15 |
|
16 ( function( factory ) { |
|
17 if ( typeof define === "function" && define.amd ) { |
|
18 |
|
19 // AMD. Register as an anonymous module. |
|
20 define( [ |
|
21 "jquery", |
|
22 "./effect" |
|
23 ], factory ); |
|
24 } else { |
|
25 |
|
26 // Browser globals |
|
27 factory( jQuery ); |
|
28 } |
|
29 }( function( $ ) { |
|
30 |
|
31 return $.effects.define( "fade", "toggle", function( options, done ) { |
|
32 var show = options.mode === "show"; |
|
33 |
|
34 $( this ) |
|
35 .css( "opacity", show ? 0 : 1 ) |
|
36 .animate( { |
|
37 opacity: show ? 1 : 0 |
|
38 }, { |
|
39 queue: false, |
|
40 duration: options.duration, |
|
41 easing: options.easing, |
|
42 complete: done |
|
43 } ); |
|
44 } ); |
|
45 |
|
46 } ) ); |