Ho开发者_高级运维w would I make it so after a certain amount of time, a script will link to lets say href="index.jpg" rel="lightbox" class="blah";
Then soon after go to the next link after another 5 seconds etc..
You will want to use the setTimeout
function to implement this:
Executes a code snippet or a function after specified delay.
If you want to do it once use setTimeout. if you want to do it over and over use setInterval
This example will call myfunc() after 5 seconds (5000 milliseconds)
setTimeout("myfunc()", 5000);
function myfunc()
{
// do what you need to do here
}
精彩评论