0

Can someone link me to a script that will rotate an ad banner on a website so a different ad appears when you refresh or revisit the page. I have a found a few scripts that rotate images but it has to be able to have the link with it too. Thanks.

3
Contributors
4
Replies
6
Views
10 Years
Discussion Span
Last Post by shailendrabisht
0

Got it, thanks though!

<SCRIPT language=JavaScript>
/*
 +---------------------------------------------------------+
 | Ad Simple                 Copyright www.YugDesign.com   |
 +---------------------------------------------------------+
 | This program may be used and hosted free of charge by   |
 |anyone for personal purpose as long as this copyright    |
 |notice remains intact.                                   |
 +---------------------------------------------------------+
*/

var img_width = "468";
var img_height = "60";
var img_title = "Click Here";


var ad=new Array()
//insert here your images src
ad[0]='gray.jpg';
ad[1]='red.jpg';
ad[2]='black.jpg';

var links=new Array()
//insert here your links
links[0]='http://www.google.com';
links[1]='http://www.yahoo.com';
links[2]='http://www.gmail.com';

var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'" border="0"></a>');
</SCRIPT>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.