javascripts
 

SimplytheBest
Scripts

ASP scripts
PERL scripts
PHP scripts
JavaScripts & Ajax
Snippets
Online scripts

Ajax, DHTML
& JavaScripts

Animation
Background
Bookmarks
Buttons
Calculators
Cookies
Data handling
E-mail
Enhancements
Forms
Image rotation
Menus
Messages
Miscellaneous
Music
Password protection
Redirection
Scrollers
Tables
Time & date
Windows

Publishers
Add script
Account login
Publisher list



 

Home > Scripts > DHTML scripts & JavaScripts > Image rotation > Banner rotator script

 

Banner rotator script

AUTHOR: Rich Galichon
TYPE: Freeware
BROWSERS: IE 4+, IE 6+, NS 4.7+, NS 6+

This script rotates banners with a specified frequency. You can control how often your banners are displayed by increasing its corresponding chance property relative to the other banners.


EXAMPLE

Reload this page to see a new banner displayed:


1)
Insert this script in the <HEAD> section of the page.

then copy (CTRL-C) & paste (CTRL-V)

2) Insert the following script in the <BODY> section where you want the rotating banners to appear in the page.

then copy (CTRL-C) & paste (CTRL-V)

3) Define the images, their location, the URL links, the <alt> tags and the 'chance property' relative to the other banners in this section of the script:

banners[0] = new banner("banners/banner1.gif", // banner name and its location
"http://planmagic.com/financial_planning.html target='_blank'",
// url link for the banner
"PlanMagic Finance Pro",
// the <alt> tag
10);
// the chance this banner has to be randomly selected

banners[1] = new banner("banners/banner2.gif",
// banner name and its location
"http://planmagic.com/marketing_planning.html target='_blank'",
// url link for the banner
"PlanMagic Marketing",
// the <alt> tag
30);
// the chance this banner has to be randomly selected

To increase the chance of a banner being randomly selected, increase its corresponding 'chance property'.

An easy to configure banner rotation script. Enjoy!


See also
Rotation CGI scripts


[BACK] [TOP]

 


Copyright © 1997-2009 SimplytheBest Inc. Terms of Use and Legal Disclaimer.
All copyrights are acknowledged. All rights reserved.