Refresh Banner After Every Webpage Visit
iWebBuddy.com - Website Design and Web Development Forum :: Web Design and Development :: Tutorials :: Coding Tutorials
Page 1 of 1 • Share •
Refresh Banner After Every Webpage Visit
This script will allow you to refresh a new banner after every web page visit.
You can find and modify the following :
1. Add an image :
2. Add a url to the banner :
3. Add ALT Text to banner :
4. Adjust size of banner :
Enjoy now,
- Code:
<script language="javascript">
<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="WEBSITE URL";
alt="iWebBuddy.com ALT TEXT";
banner="URL OF IMAGE";
width="100";
height="100";
}
if (ad==2) {
url="WEBSITE URL";
alt="iWebBuddy.com ALT TEXT";
banner="URL OF IMAGE";
width="100";
height="100";
}
if (ad==3) {
url="WEBSITE URL";
alt="iWebBuddy.com ALT TEXT";
banner="URL OF IMAGE";
width="100";
height="100";
}
document.write('<right>');
document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0></a><br/>');
document.write('</right>');
// End -->
</script>
You can find and modify the following :
1. Add an image :
banner="URL OF IMAGE";
2. Add a url to the banner :
banner="URL OF IMAGE";
3. Add ALT Text to banner :
alt="iWebBuddy.com ALT TEXT";
4. Adjust size of banner :
width="100";
height="100";
Enjoy now,
Last edited by Marc on Sun Dec 06, 2009 3:55 pm; edited 1 time in total (Reason for editing : made the tutorial simple to edit)

Marc- Administrator

Posts: 1119
iCoins: 2197
Forum Pet:

Re: Refresh Banner After Every Webpage Visit
This tutorial has been edited to help others understand the script better, 



Marc- Administrator

Posts: 1119
iCoins: 2197
Forum Pet:

Permissions of this forum:
You cannot reply to topics in this forum












