| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
( function( factory ) { |
| 17 |
"use strict"; |
| 18 |
|
| 19 |
if ( typeof define === "function" && define.amd ) { |
| 20 |
|
| 21 |
|
| 22 |
define( [ |
| 23 |
"jquery", |
| 24 |
"../version", |
| 25 |
"../effect" |
| 26 |
], factory ); |
| 27 |
} else { |
| 28 |
|
| 29 |
|
| 30 |
factory( jQuery ); |
| 31 |
} |
| 32 |
} )( function( $ ) { |
| 33 |
"use strict"; |
| 34 |
|
| 35 |
return $.effects.define( "highlight", "show", function( options, done ) { |
| 36 |
var element = $( this ), |
| 37 |
animation = { |
| 38 |
backgroundColor: element.css( "backgroundColor" ) |
| 39 |
}; |
| 40 |
|
| 41 |
if ( options.mode === "hide" ) { |
| 42 |
animation.opacity = 0; |
| 43 |
} |
| 44 |
|
| 45 |
$.effects.saveStyle( element ); |
| 46 |
|
| 47 |
element |
| 48 |
.css( { |
| 49 |
backgroundImage: "none", |
| 50 |
backgroundColor: options.color || "#ffff99" |
| 51 |
} ) |
| 52 |
.animate( animation, { |
| 53 |
queue: false, |
| 54 |
duration: options.duration, |
| 55 |
easing: options.easing, |
| 56 |
complete: done |
| 57 |
} ); |
| 58 |
} ); |
| 59 |
|
| 60 |
} ); |