如何重定向无限数量的url或iframe与所有它们之间的时间差距

How to Redirect unlimited number of urls or iframes with a time gap in between all of them

本文关键字:之间 差距 时间差 时间 iframe 无限 重定向 url      更新时间:2023-09-26

基本上我正试图找到一种方法,我可以自动重定向视频上的swagbucks,而不必每次在30秒的时间内手动点击它们。所以我一直在研究如何重定向我想要的任意数量的url或iframe,并在所有它们之间的时间间隔一次显示它们。我能够找到一个例子,重定向2组iframe,但当我试图重定向3或更多,它显示在一起。下面是我的尝试:

<?php
header("Location: http://globalvideo.swagbucks.com/video/persia-whiteif-people-knew/289/64423"); 
exit();
?>
<script language="JavaScript">
var time = null
function move() {
myiframe.location.href = 'http://globalvideo.swagbucks.com/video/blue-ruin/185/415878'; 
}
</script>
<body onload="timer=setTimeout('move()',5000)">
<iframe id="myiframe" name="myiframe" src=" http://globalvideo.swagbucks.com/video/persia-whiteif-people-knew/289/64423"> </iframe>

嗯,因为你没有给我们一个Fiddle,所以重做你的代码有点困难。

不管怎样,我写了一个小提琴,我相信你会用的。

<<p> JSFIDDLE演示/strong>

我正在使用jQuery,我建议你使用:

这是主要功能:

 setInterval(function(){
   i+=1;
      if(i>2){
     i=0;
     }
    $("iframe").attr("src", links[i]);
}, 3000);