我需要以不同的时间间隔旋转图像,例如第一张图像应该是 10 秒,第二张是 20 秒计时器等。请任何人都可以帮助我。我在下面有这个脚本:
<script type="text/javascript">
var imgs3 = new Array("../webroot/img/1.jpg", "../webroot/img/2.gif", "../webroot/img/3.gif");
var lnks3 = new Array("www.a.com", "www.b.com", "www.c.com");
var alt3 = new Array("StarBid", "Happy Winners", "Special Offer");
var currentAd3 = 0;
var imgCt3 = 3;
function cycle3() {
if (currentAd3 == imgCt3) {
currentAd3 = 0;
}
var banner3 = document.getElementById('adBanner3');
var link3 = document.getElementById('adLink3');
banner3.src = imgs3[currentAd3]
banner3.alt = alt3[currentAd3] document.getElementById('adLink3').href = lnks3[currentAd3]
currentAd3++;
}
window.setInterval("cycle3()", 10000);
<script>