iWebBuddy.com - Website Design and Web Development Forum
Thanks for visiting iWebBuddy.com ,

If it is your first time here, please enjoy reading the tutorials and articles. If you can not find what you're looking for, then you can join the forums by registering so you will be able to log into the forums and ask for support for website development, request graphic designing services, promote your website, request website reviews, get advice from others about your website or be an active member of the community to help iWebBuddy.com grow.

After you register an account, you are required to log in. Once you log into your account, you will have more privileges. You will be able to post on the forums, send private messages and view the Chatbox ( link ) at the bottom of the forums.

Have a nice day.

Refresh Banner After Every Webpage Visit

Post new topic   Reply to topic

View previous topic View next topic Go down

Refresh Banner After Every Webpage Visit

Post by Marc on Fri Oct 16, 2009 7:20 pm

This script will allow you to refresh a new banner after every web page visit.

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, Very Happy


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
Administrator

Posts Posts: 1119
iCoins iCoins: 2197
Forum Pet: Website Design and Development Monster

View user profile http://www.iwebbuddy.com

Back to top Go down

Re: Refresh Banner After Every Webpage Visit

Post by Marc on Sun Dec 06, 2009 3:56 pm

This tutorial has been edited to help others understand the script better, Wink







Marc
Administrator
Administrator

Posts Posts: 1119
iCoins iCoins: 2197
Forum Pet: Website Design and Development Monster

View user profile http://www.iwebbuddy.com

Back to top Go down

View previous topic View next topic Back to top


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