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  

RSS
.

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">
//Javascript
//store the quotations in arrays
var images = [],
index = 0;
images[0] = "<a href = 'http://news.indonewyork.com/index.php?mod=article&cat=Babes'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/babes-1.jpg' alt='Soccer Babes'></a>";
images[1] = "<a href = 'http://news.indonewyork.com/index.php?mod=article&cat=Babes'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/babes-2.jpg' alt='Soccer Babes'></a>";
images[2] = "<a href = 'http://news.indonewyork.com/index.php?mod=article&cat=Babes'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/babes-3.jpg' alt='Soccer Babes'></a>";
images[3] = "<a href = 'http://highlights.indonewyork.com/browse/videos/z/0/1/RecentlyAdded'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/highlights-1.jpg' alt='Soccer Highlights'></a>";
images[4] = "<a href = 'http://highlights.indonewyork.com/browse/videos/z/0/1/RecentlyAdded'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/highlights-2.jpg' alt='Soccer Highlights'></a>";
images[5] = "<a href = 'http://highlights.indonewyork.com/browse/videos/z/0/1/RecentlyAdded'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/highlights-3.jpg' alt='Soccer Highlights'></a>";
images[6] = "<a href = 'http://soccer.indonewyork.com/category/football-jokes'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/football-lol-1.jpg' alt='Soccer LOL'></a>";
images[7] = "<a href = 'http://soccer.indonewyork.com/category/football-jokes'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/football-lol-2.jpg' alt='Soccer LOL'></a>";
images[8] = "<a href = 'http://soccer.indonewyork.com/category/football-jokes'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/football-lol-3.jpg' alt='Soccer LOL'></a>";
images[9] = "<a href = 'http://soccer.indonewyork.com/category/league-tables'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/table-1.jpg' alt='Table'></a>";
images[10] = "<a href = 'http://soccer.indonewyork.com/category/league-tables'><img src='http://indobux.biz/indonewyork/soccer/soccer-banners/table-2.jpg' alt='Table'></a>";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
//done
</script>

IndoNewYork





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 GoDaddy.com. $5.99 .COM!