see example of script in action here: http://www.smftutorials.com/testing/template.html It will go through 4-5 images, and then no image, then 3-4 more, then no image again... how can I change this script to keep rotating images with no breaks? <script type="text/javascript"> var imgs1 = new Array("http://www.smftutorials.com/images/r-banners/pic1.jpg","http://www.smftutorials.com/images/r-banners/pic2.jpg","http://www.smftutorials.com/images/r-banners/pic3.jpg","http://www.smftutorials.com/images/r-banners/pic4.jpg","http://www.smftutorials.com/images/r-banners/pic5.jpg","http://www.smftutorials.com/images/r-banners/pic6.jpg","http://www.smftutorials.com/images/r-banners/pic7.jpg","http://www.smftutorials.com/images/r-banners/pic8.jpg","http://www.smftutorials.com/images/r-banners/pic9.jpg","http://www.smftutorials.com/images/r-banners/pic-10.jpg","http://www.smftutorials.com/images/r-banners/pic-11.jpg","http://www.smftutorials.com/images/r-banners/pic-12.jpg","http://www.smftutorials.com/images/r-banners/pic-13.jpg"); var lnks1 = new Array("http://www.soapmakingforum.com","http://www.smftutorials.com/how-to-make-sand-candles-tutorial.html","http://www.smftutorials.com/how-to-make-soap-scroll-tutorial.html","http://www.smftutorials.com/how-to-make-bath-bombs-tutorial.html","http://www.smftutorials.com/how-to-make-melt-and-pour-gemstone-and-rock-soap-tutorial-revisited.html","http://www.smftutorials.com/6-color-swirl-tutorial.html","http://www.smftutorials.com/how-to-line-a-wooden-soap-mold-tutorial.html","http://www.smftutorials.com/soap-packaging-idea-tutorial.html","http://www.smftutorials.com/how-to-make-rebatch-soap-tutorial.html","http://www.smftutorials.com/how-to-make-salt-soap.html","http://www.smftutorials.com/how-to-make-your-own-silicone-soap-mold-liners-tutorial.html","http://www.smftutorials.com/how-to-make-your-own-custom-soap-stamps-tutorial.html","http://www.smftutorials.com/soap-wrapping-ideas-tutorial.html"); var currentAd1 = -1; var imgCt1 = 13; function cycle1() { if (currentAd1 <= imgCt1) currentAd1++; else { currentAd1 = 0; } var banner1 = document.getElementById('adBanner1'); var link1 = document.getElementById('adLink1'); banner1.src=imgs1[currentAd1] document.getElementById('adLink1').href=lnks1[currentAd1] currentAd1++; } window.setInterval("cycle1()",3000); </script> <a href=""http://www.soapmakingforum.com"" id="adLink1" target="_top"> <img src="http://www.smftutorials.com/images/r-banners/pic1.jpg" id="adBanner1" border="0" width="500" height="250"></a> Code (markup):
ian- see my message to you - some of those images are not even on the server, so can not show up. other than that - see the PM
If you're going to use brackets use them consistently. I'm not being a nit picker. Good syntax will keep you from getting stray bugs. Like this: if (currentAd1 <= imgCt1) { currentAd1++; } else { currentAd1 = 0; } Code (markup):