tags:

views:

45

answers:

3

Hi all,

Here I have a funtion

function photoLoop() {
fade1L('3000');fade1M('3500');fade1R('4000');show2L('3000');show2M('3500');show2R('4000');
}

When the page loads this function is called <body onload="photoLoop();>

At this point these functions are run until it reaches the end i.e show2R('4000');

My problem is I want it to now go back to fade1L('3000'); and start over.

How can this be done, with out crashing I.E ?!

A: 

Use setTimeout().

You can do

setTimeout(photoLoop, 1000); // call the function after 1 second.
Vijay Dev
A: 

Instead of calling the function directly, do the following which will repeat the function at the specified interval:

setInterval(photoLoop, 1000);

Where 1000 is the interval to repeat the function in milliseconds. You will presumably want to set this to the total duration of these animations (21000ms at a guess).

Luke Bennett
+2  A: 

Use the jQuery Effects library and make use of the 'callback' functionality

e.g. http://docs.jquery.com/Effects/fadeIn

John Polling