1. Home
  2. Computing & Technology
  3. JavaScript

Cycling Banner

Part 1 : Introduction

One method of creating an animated image is to create it as an animated gif file. This is all very well for simple images but what happens if you want to include photos or other complex images in your animation sequence?

The answer is to use a Javascript function to replace the image at regular intervals, that way you can use whatever images that you like in the sequence as long as all of the images are the same size. Since this effect is often used to replace ad banners, it is usually referred to as a rotating banner script but as you will see, the effect can be used for whatever images you like as long as they are all the same size.

You can easily create a cycling banner effect like this for your web page.

Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.