I have make a animation with a interval. This is my script:
var count = 0; var countSecond = -40; function arrowAnimation() { if (count > 40) { clearInterval(); } $('.list-what-we-do .arrow').css({ top: (count++) + 'px' }); } function arrowAnimationSecond() { if (countSecond > 0) { clearInterval(); } $('.list-what-we-do .arrow').css({ right: (countSecond++) + 'px' }); } setInterval(arrowAnimation, 5); setInterval(arrowAnimationSecond, 5); Now my question. How can i stop the interval. I used clearInterval. But that is not working. How can i fix this? Thanks for helping!