ASP ScriptingJava ScriptingCGI ScriptingHTMLJavaLanguage CERP Education Links

JAVA SCRIPTING

Making Cycling Banners

     It's common to see that advertising banners that periodically switch between images. Most of these are animated GIF files that contain a number of frames which play in succession. You can do such type of things very easily by using JavaScript coding with or without animated GIF files.

<HTML>
<HEAD>
<TITLE>Cycling Banners</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT>
var addimages=new Array("banner1.gif","banner2.gif","banner3.gif")
var thisad=0
var imgcnt=3
function cycle()
{
if (document.images)
{
thisad++
{
if (thisad == imgcnt)
{
thisad=0
}
document.adBanner.src=adImages[thisAd]
setTimeout("cycle()",3*1000)
}

}
</SCRIPT> 
</HEAD>
<BODY BGCOLOR=WHITE onload="cycle()">
<CENTER><IMG SRC=banner1.gif" WIDTH="400" HEIGHT="75" NAME="adBanner"></CENTER>
</BODY>
</HTML>

 


Your Ad Here
Not All Of Your Subscribers Use RSS - AWeber Email Marketing
Your Ad Here