jQuery opacity animation
jQuery's .animate()
takes values from 0
to 1
.
$(document.body).animate({opacity: 0}, 1000);$(document.body).animate({opacity: 1}, 1000);
I'm sure that .animate()
must call .parseFloat()
(or something) on the values you're passing, which would make your 0%
into 0
(which is correct), but your 100%
into 100
, which would be incorrect.
You can use functions or something like this:
$(document.body).animate({ opacity: 1/2 }, 1000);