Rotating and Fading Banner Ad

This is a nice transition banner rotating script. if you have IE it will do a nice morph between the images and if you have Netscape it will simply replace the current image with the next image.

Source code for rotating and fading banner add:

  
<html>
<head>
<script language="JavaScript">
<!-- // Hide from old browsers -- 
/* This is a transition banner rotating script 
   uses IE filters. Netscape does a simple image
   swap */
var step=1
/* change speed below (in seconds)
   this value determines how long
   each banner remains before it 
   is changed */
var speed=2
/* ================IMAGES ================ */
/*	Begin Edit Here	     
   Add images as needed, but remember to 
   update the number of images variable */
/* Number of Images */
var number_of_images=3
/* Image 1 */
var image1=new Image()
image1.src="images/banner1.jpg"
/* Image 2 */
var image2=new Image()
image2.src="images/banner6.jpg"
/* Image 3 */
var image3=new Image()
image3.src="images/banner3.jpg"

/* ======================================= */
window.onerror=reapply
function reapply() {
	/* Incase of an error, restart banner rotation */
	setTimeout("slideit()",2000);
	return true;
}
function slideit(){
	if (!document.images)
		return;
	if (document.all)
		slide.filters.blendTrans.apply();
	document.images.slide.src=eval("image"+step+".src");
	if (document.all)
		slide.filters.blendTrans.play();
	if (step<number_of_images)
		step++;
	else
		step=1;
	if (document.all)
		setTimeout("slideit()",speed*1000+3000);
	else
		setTimeout("slideit()",speed*1000);
}
// -->
</script>
</head>
<body onLoad="slideit();">
<!-- // The following image tag is the place holder for the banner // -->
<IMG name=slide src="images/banner1.jpg" style="FILTER: blendTrans(duration=3)">
</body>
</html>
Back