Rotating Banners Ad Clickable Script

This is a hot topic for all bloggers, everyone is looking for the code / script to put Rotating Banners on their blog, normally the Header, Footer or Sidebar!

The great news is that I have that script for you, this way you can promote different affiliate programs or products wihtout having to fill up your entire blog with annoying ads, just one space will take care of all the advertising with Rotating Banner or text ad.

<script type="text/javascript">
var imgs1 = new Array("http://www.ilovehits.com/refbanners/ILH125.gif","http://www.trafficswarm.com/images/b12060.gif","http://static.easyhits4u.com/img/banners/125x125_2.gif","http://www.cash-twist.com/banners/125125cashtwist_com.gif","http://donothingmoney.com/img/ca125x125.jpg","http://www.zubie.net/banners/banner_125X125.png");
var lnks1 = new Array("http://www.ilovehits.com/?rid=78164","http://www.trafficswarm.com/go.cgi?470076","http://www.easyhits4u.com/?ref=strosdegoz","http://cash-twist.biz","http://donothingmoney.com","http://www.zubie.net/id/strosdegoz");
var alt1 = new Array("iLoveHits","tw","easyhits","ct","CA","zubie");
var currentAd1 = 0;
var imgCt1 = 6;
function cycle1() {
if (currentAd1 == imgCt1) {
currentAd1 = 0;
}
var banner1 = document.getElementById('adBanner1');
var link1 = document.getElementById('adLink1');
banner1.src=imgs1[currentAd1]
banner1.alt=alt1[currentAd1]
document.getElementById('adLink1').href=lnks1[currentAd1]
currentAd1++;
}
window.setInterval("cycle1()",3000);
</script>
<a href=""http://www.ilovehits.com/?rid=78164"" id="adLink1" target="_top">
<img src="http://www.ilovehits.com/refbanners/ILH125.gif" id="adBanner1" border="0" width="150" height="150"></a>

Now this is the 150×150 rotating banners that you can see on my sidebar, this is specially for 150×150 banners and smaller if you wish a script for bigger banners like 468×60 just leave a coment and I will get it for you.

To get this Script working with your own images and links you need to edit few things :

var imgs1 – defines the images url, edit each url with your own banner image url

var lnks1 – defines the link the banner will redirect to when clicked

var imgCt1 – defines the number of banner you want rotating

window.setInterval – defines the rotating time, 1,000 = 1 second

If you have any questions leave a comment, if you like this post please follow my blog.

Kind Regards

Dirson E. Jimenez Santana (strosdegoz)

19 thoughts on “Rotating Banners Ad Clickable Script

  1. sir yes i want banners like 468×60 thanks you so much for this wonderful tutorial

    • Here is the code for 5 banners ads size 468×60
      They will refresh every 6 seconds and open in a new window when clicked.
      The code must be copied exactly as shown and edit all the links and images with yours!!
      The last part at the bottom is needed for the script to work correctly, if you do as instructed
      you should have any problems, Regards

      
      
      
      
      
  2. sir how can i put up 10 banners there? and randomly appear?

    anyway thank you so much for your fast reply sir!

  3. about this code what is the purpose of this sir?

    You may use these HTML tags and attributes:

    
    

  4. Blogs On Blogger Directory says:

    That’s A Great Code Brother, Been looking for such code to add to my Blogger Blogs Directory found here.
    Thanks.

  5. Hi, Strosdegoz.

    Thanks a lot for this wonderful script. It is excellent and working on my site.
    Love it so much.

    Good work!

    Regards,

  6. Great Code. I have it working great on my blog but I want to put multiple banners on my page. When I copy the code to a new gadget and change the images, etc. It combines them into one instead of having two separate banners. How can I put two different banners on my page?

  7. Here is the page I am working on http://skiatookskoop.blogspot.com/
    I just put identical ones on there to show you what is happening. They should rotate through 3 images. The second one never changes and the first one only changes once. If I delete one of them they work perfectly.
    Thanks for your help

  8. hi,
    great scipt, thnaks. i was looking for something like this for a long time.
    one q, don’t mean to be unfair but, is there a way not to show “i love hits banner”?