I have a simple interval which subtracts 0.1 each time around. But the number sequence goes weird after 3 iterations... this is what i have:
function transition_opacity(div_id,opacity){
    opacity = 1; //temporary test
    var IntervId = setInterval(process_transition,30);
    function process_transition(){
        console.log(opacity); //check the value
        opacity = opacity -  0.1
        div_id.style.opacity = opacity;
    if(opacity < 0.0){
            rmv_div(div_id);
            clear();
        }
    }
    function clear(){
         clearInterval(IntervId);
    }
}
The console log shows this for the value of opacity:
1
0.9 
0.8 
0.7000000000000001
0.6000000000000001
0.5000000000000001
0.40000000000000013 
0.30000000000000016
0.20000000000000015
0.10000000000000014
1.3877787807814457e-16 
Why is it doing this crazy number sequence =/ doesn't seem to make sense to me... it works fine up to 0.8
 
     
     
    