This Girl's Ass Shake will Make Your Jaws Drop ; Hottest Fitness Instructor - Eva Andressa ; U-S-A ... U-S-A ... U-S-oooooh ; Awas Uang Koin Palsu, Cocok-kan dulu koin-mu Dengan Gambar ini ; GIF - Dancer Embarassed Of Her Pussy
::| Keyword:       [Advance Search]
  Technology » Software & Internet » Encoding & Javascripts  


Show Random Image, Banner and Link Using Javascript

Wednesday, 07.04.2012, 07:13am (GMT-5)

banner-rotatorSometimes we want to show different banners or pictures and the links on the same page on the same spot every time a visitor logs in, so they don't get bored, right? this is the javascript to do it.

You can call it banner rotator, image rotator, link rotator, the point is you don't really control which one is going show up, the image and/or the link will show up randomly.

This is good especially if you have different banners from the same advertiser who don't want their banner to look the same every time they visit your site.

Or, you can just put up images and link them to other parts of your site, but your visitors will see different images every time they visit.

That is the awesomeness of this banner rotator, and below is the example of the banner rotator javascript. Click reload/refresh button on your browser to see how it works.

Below is the javascript to do the random image, banner and link rotator, just copy paste it and make the changes to the image link and url link

<script type="text/javascript">
//store the quotations in arrays
var images = [],
index = 0;
images[0] = "<a href = ''><img src='' alt='Soccer Babes'></a>";
images[1] = "<a href = ''><img src='' alt='Soccer Babes'></a>";
images[2] = "<a href = ''><img src='' alt='Soccer Babes'></a>";
images[3] = "<a href = ''><img src='' alt='Soccer Highlights'></a>";
images[4] = "<a href = ''><img src='' alt='Soccer Highlights'></a>";
images[5] = "<a href = ''><img src='' alt='Soccer Highlights'></a>";
images[6] = "<a href = ''><img src='' alt='Soccer LOL'></a>";
images[7] = "<a href = ''><img src='' alt='Soccer LOL'></a>";
images[8] = "<a href = ''><img src='' alt='Soccer LOL'></a>";
images[9] = "<a href = ''><img src='' alt='Table'></a>";
images[10] = "<a href = ''><img src='' alt='Table'></a>";
index = Math.floor(Math.random() * images.length);


Related Articles:
Simple Redirect Javascript Code
How to Make Quote Box in HTML
How To Get Rid Of  On Top Of Your Page

Re-Think $5.99 .COM!