What is the difference between fadeIn
vs fadeOut
vs fadeTo
?
views:
59answers:
3
+1
A:
FadeIn.. Shows an element gradually
FadeOut .. Hides an element gradually
FadeTo .. Changes the opacity of an element to a given value
dejavu
2010-07-22 17:49:11
+1
A:
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.
David Hedlund
2010-07-22 17:50:06
A:
I see only linguistic redundance here, since fadeTo fits all the use cases regardless.
Davi Lima
2010-09-30 13:19:55