I'm curious how .fadeTo()
fades an element? Does it use an inline style of opacity to do this?
And if it does not use css opacity, then how would you control css opacity using jQuery or javascript?
This question is referring to all of the following:
.fadeTo()
.fadeIn()
.fadeOut()
From the jQuery source - CSS opacity.
fadeTo: function( speed, to, easing, callback ) {
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, easing, callback);
It does use CSS opacity!
Check out the source code here: http://code.jquery.com/jquery-latest.js
And search for fadeTo
.
You will see (as of today, anyway):
fadeTo: function( speed, to, easing, callback ) {
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, easing, callback);
},
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