I have a bunch of functions that calls another function. I want to run those group of functions in an infinite loop and can't really come up with a logic.
My code looks like this:
<script>
function runAnim(x,y) {
//animation code
}
runAnim(a,2);
setTimeout(function() {
$('#a').fadeOut('fast');
}, 3000);
runAnim(b,4);
setTimeout(function() {
$('#b').fadeOut('fast');
}, 3000);
</script>
So I want to run these two 'runAnim' functions in an infinite loop. I tried
while(1) {}
but this hangs up my browser. I tried implementing setInterval method but don't know how I can do this. If you want I can post the runAnim(x,y) function for more clarity.