How to know when an object opacity reaches a value of 0 using jQuery -


i have object gradually goes transparent , set callback function when object's opacity reaches value of 0, can reset opacity , position when completed.

here code far:

 var angle = 0;  var reverseangle = 0;   setinterval(function(){     angle+=3;     reverseangle-=3;     $("#part1, #part3, #part5, #part7").rotate(angle);     $("#part4, #part2").rotate(reverseangle);     $("#part9").animate({       opacity: "-=0.1",       top: "-=1"      }, 800);   },50); 

you can add callback function end of animation.

$("#part9").animate({       opacity: "-=0.1",       top: "-=1"      }, 800, function(){         if($(this).css("opacity") <= 0){            stuff         }     } ); 

i added <=, in case


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -