when div visible start animation

when div visible start animation and when div unvisible stop animation.
add if condition proper place check console for more details.