Ive got the following script in my page, it switches page every 10 seconds which works well however I would prefer it to wait until the page it load up is completed before moving onto the next link because some people who use it are finding the pages aren't loading completely before it switches. Anyone know if its a simple change from 10000 to a different variable? Im just drawing a blank.
<script type="text/javascript">
var win = null;
var i = 0;
var links = [
<!--Link 1-->
"url",
<!--Link 2-->
"url",
<!--Link 3-->
"url",
<!--Link 4-->
"url"
];
function cranking(idx) {
if(!win){
win = window.open();
};
win.location.href = (links[idx]);
if(idx < (links.length - 1)) {
idx++;
setTimeout('cranking(' + idx + ')', 10000);
//or setTimeout('cranking(idx)', 10000);
};
};
</script>