codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Banner</title>
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
<script language="javascript" type="text/javascript">
var imm = new Array();
 imm[0] = "immagine-1.jpg";
 imm[1] = "immagine-2.jpg";
 imm[2] = "immagine-3.gif";
 imm[3] = "immagine-4.png";
 imm[4] = "immagine-5.bmp";
 imm[5] = "immagine-6.gif";
 
var lnk = new Array();
 lnk[0] = "http://www.google.it/";
 lnk[1] = "http://www.google.it/";
 lnk[2] = "http://www.google.it/";
 lnk[3] = "http://www.google.it/";
 lnk[4] = "http://www.google.it/";
 lnk[5] = "http://www.google.it/";
 
var div = new Array();
 div[0] = "mostra";
 div[1] = "mostra2";
 div[2] = "mostra3";

var x=0;

window.onload=function(){
	mostra_banner();
}
function mostra_banner(){
	for (var i=0; i<div.length; i++){
		$('#'+div[i]).fadeOut(250, function(){
			$(this).html("[img]" + imm[x] + "[/img]");
			$(this).fadeIn(500);
			if(imm.length - 1 == x ){
				 x = 0;
			}else{
				x++;
			}
		});
	}
	setTimeout('mostra_banner()',3000);
}
</script>
</head>

<body>
<div id="mostra"></div>
<div id="mostra2"></div>
<div id="mostra3"></div>
</body>
</html>
jquery powered