What is the difference between fadeIn vs fadeOut vs fadeTo ?
fadeIn fades from an elements current opacity to 1.fadeOut fades from an elements current opacity to 0.fadeTo fades from an elements current opacity to a given opacity.
$('#myObject').fadeTo('fast', 0.5, function() {
$('#myObject').fadeTo('fast', 0.8);
});
The above fades myObject from whatever opacity it has, to 0.5, which is 50% transparency, and after that, it fades up again to 20% transparency.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With