I have a variable of unknown value, it will be an integer. For this sake, lets say var a = 3;
I have a function that is called continuously:
var a = 3;
function anim() {
left = parseInt(galleryInner.css('left'), 10);
if(Math.abs(left) >= (galleryItem.length * galleryItem.width())){
galleryInner.css('left', 0);
}
galleryInner.animate({left: '-=20' }, 200, anim);
that.appendEnd();
}
I'd like run this.appendEnd() only every 3 times, because a === 3.
How can I do this?
var ain this code