Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random Banners With Javascript
Author Message
Admin Offline
Administrator
*******

Posts: 54
Joined: Nov 2009
Reputation: 0
Post: #1
Random Banners With Javascript
Use this code where ever you want Random Banner with Link to appear

Code:
<script language="Javascript">
<!--


var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

link = new initArray(
"http://www.linkofsite1.com",
"http://www.linkofsite2.com",
"http://www.linkofsite3.com"

);

image = new initArray(
"http://linkofbanner1.com",
"http://linkofbanner2.com",
"http://linkofbanner3.com"

);

text = new initArray(
"Name Of Site1",
"Name Of Site2",
"Name Of Site3"

);

var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink  = link[core];
var ranimage = image[core];
var rantext  = text[core];

document.write('<a href=\"' +ranlink+ '\" target=\"_blank\"><img src=\"'+ranimage+'\" border="0" alt=\"'+rantext+'\"></a>');

//-->
</SCRIPT>
(This post was last modified: 11-28-2009 06:38 PM by Admin.)
11-28-2009 06:38 PM
Find all posts by this user Quote this message in a reply
BennyAK Offline
Junior Member
**

Posts: 1
Joined: Dec 2009
Reputation: 0
Post: #2
RE: Random Banners With Javascript
need more tutorial for rotating javascript/html codes such as bidvertiser, speedyads, googleadsense, etc

Thank You
12-19-2009 07:54 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump: