I think the code will show the ad at random,but i want the ad be load one by one ,5s interval anyone help me will be appreciated or is there have another codes to do the job? <script language=”javascript”> var how_many_ads = 3; var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) { txt=”“; url=”“; alt=”“; banner=”“; width=”468″; height=”60″; } if (ad==2) { txt=” “; url=” “; alt=” “; banner=” “; width=”468″; height=”60″; } if (ad==3) { txt=” “; url=” “; alt=” “; banner=” “; width=”468″; height=”60″; } document.write(’<center>’); document.write(’<a href=”‘ + url + ‘” target=”_top”>’); document.write(’<img src=”‘ + banner + ‘” width=’) document.write(width + ‘ height=’ + height + ‘ ‘); document.write(’alt=”‘ + alt + ‘” border=0><br>’); document.write(’<small>’ + txt + ‘</small></a>’); document.write(’</center>’); </script>
Check this out, with a bit of tweaking it will do the job http://stackoverflow.com/questions/11350993/using-jquery-loop-to-alternate-image-scr