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 > Image rotation script

 

Image rotation javascript

AUTHOR: Infohiway
TYPE: Freeware
BROWSERS: Javascript enabled all

A random image rotation script. This script will change the sponsor image by image, swapping every set period of time (5 seconds in this example) without having to reload the page.


EXAMPLE

Wait 5 seconds for the banner to change.


1)
Insert this script in the <BODY> section where you want the image swapping rotator to appear in the page.

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

2) Define the swapping images, the links and the HTML to appear with the images in this section of the script:

var ads = new adArray(
"images/banner_1.gif","http://planmagic.com",
"images/banner_2.gif","http://simplythebest.net",
"images/banner_3.gif","http://simplythebest.net/scripts/");
var ad_num = getAdNum(); 
document.write('<CENTER><TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0><TR><TD '
+'ALIGN=CENTER><FONT SIZE=2 FACE=Arial><B>SimplytheBest DHTML Scripts & JavaScripts is sponsored by: '
+'</FONT></TD><TR></TR><TD><A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
+'WIDTH="468" HEIGHT="60" BORDER=0 name=js_ad></A></TD></TR></TABLE></CENTER>');

3) Choose how fast you want your images to swap in this section of the script:

setTimeout("rotateSponsor()",5000); // the default is a new image every 5 seconds


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.