I have a javaScript function.
JavaScript:
function opacZero(object){
var presentOpacity = (object.style.opacity);
object.style.opacity =presentOpacity-0.2;
setTimeout( function(){opacZero(object)}, 40);
}
Now when I pass som eobject to this function, its opacity should reduce till 0 and go beyond 0 (as I am not clearing the timeout anywhere). But this is not happening. The opacity reduces to 0.20000000000000007 and reduces no more. But when I subtract 0.3 (or more) instead of 0.2, it is giving the desired result. But why not with numbers less than 0.2. I have no idea why this is happening. Help PLease