Saturday, 17 August 2013

Continuous loop of fade in/out function

Continuous loop of fade in/out function

I have the following function that I would like to run on a continuous
loop and I thought this would work for me, but not so because the function
only runs once. I am not sure if the problem is with the method, the
interval or my code. I am fairly new at this.
var c = $(".test p").length;
setInterval(faderepeat(c),20000);
function faderepeat(c){
var i = 0;
while (i<=c) {
var p = $(".para");
($(p[i]).delay(i*3000).fadeIn(2000).fadeOut(1000));
i++;
}
}

No comments:

Post a Comment