間隔のあるアニメーションを作成しました。これは私のスクリプトです:
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);
今私の質問。間隔を停止するにはどうすればよいですか。clearInterval を使用しました。しかし、それは機能していません。どうすればこれを修正できますか? 助けてくれてありがとう!