If I am right, the banner rotation is javascript job, right?
But we can combine php and its database feature with the javascript, and create the database backed banner rotation (so the banner image links and url links could be managed in the database.)
Any good codes samples like this?
I have another question, I am looking for some codes that can rotate the image banner and also rotate the text below the image banner.
I saw some flash file could do this.
And I already modified some javascripts to do that too. Such as
http://www.cgiscript.net/cgi-script/csNews/csNews.cgi?database=js_misc%2edb&command=viewone&id=57
<ilayer id="l1">
<layer id="l2">
<div id="l1">
<div id="l3" style="position:relative">
</div>
</div>
</layer>
</ilayer>
<script language="JavaScript">
<!--
// ********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ********************************************
var bannerArray = new Array();
var myCount=0;
// Banner Code Assignment
bannerArray[0] = "<A HREF=\"http://www.aceinstall.com\"><IMG SRC=\"http://www.aceinstall.com/banners/ban-468x60.gif\" border=\"0\" width=\"468\" height=\"60\"></A>";
bannerArray[1] = "<A HREF=\"http://www.cgiscript.net\"><IMG SRC=\"http://www.cgiscript.net/banners/ban-468x60.gif\" border=\"0\" width=\"468\" height=\"60\"></A>";
bannerArray[2] = "<A HREF=\"http://www.aceinstall.com\"><IMG SRC=\"http://www.aceinstall.com/banners/aniban-468x60.gif\" border=\"0\" width=\"468\" height=\"60\"></A>";
bannerRotate();
function bannerRotate() {
if(myCount > bannerArray.length-1){myCount=0;}
// Write out rotation
if (document.all){ // it is IE
document.all.l3.innerHTML=bannerArray[myCount];
}
else if (document.layers){ // it is NN
document.layers.l1.document.layers.l2.document.open();
document.layers.l1.document.layers.l2.document.write(bannerArray[myCount]);
document.layers.l1.document.layers.l2.document.close();
}
setTimeout("bannerRotate()", 3000);
myCount++;
}
// -->
</script>
All I need to do is attach the text such as "<br><br>"to bannerArray[0], bannerArray[1} ... assignments etc. Then the rotate text will show below the rotate banner.
But this script only works in the IE, I am looking for scripts good, clean and simple as this but works in teh IE, Netscape etc.
Any suggestions? Javascript or php scirpt solutions?