I made a function to do FadeOut on <div>
once I finished loading the page but I can not get the exact value of the end of FadeOut (that would be 0) always give me a number like this: 0.009999999999999247; / p>
How can I do to subtract correctly and get 0?
function fadeOut(id){
//pega o elemento da página
obj = document.getElementById(id);
//seta a opacidade como 0
obj.style.opacity = 1.00;
fazFadeOut = function (){
if(obj.style.opacity != 0){
var atual = Number(obj.style.opacity);
var newopac = atual - Number(0.01);
obj.style.opacity = String(newopac);
if(obj.style.opacity == 0){
obj.style.display = 'none';
}
setTimeout('fazFadeOut()', 10);
}
}
fazFadeOut();
}