Rotador de banners tipo cubo
<script type="text/javascript"> var imgwidth=700 var imgheight=90 var pos_left=150 var pos_top=970 var imgname=new Array() imgname[0]="objetos/llamas01.gif" imgname[1]="objetos/new05.gif" imgname[2]="objetos/botes01.gif" imgname[3]="objetos/esferametal02.gif" var imgurl=new Array() imgurl[0]="http://www.tu enlace.com" imgurl[1]="http://www.tu enlace.com" imgurl[2]="http://www.tu enlace.com" imgurl[3]="http://www.tu enlace.com" var imgpreload=new Array() for (i=0;i<=imgname.length-1;i++) { imgpreload[i]=new Image() imgpreload[i].src=imgname[i] } var pause=2000 var speed=20 var step=10 var i_loop=0 var i_image1=0 var i_image2=1 function stretchimage() { if (i_loop<=imgwidth) { if (document.all) { imgcontainer1.innerHTML="<a href='"+imgurl[i_image1]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+imgname[i_image1]+"' border='0'></a>" document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft+i_loop imgcontainer2.innerHTML="<a href='"+imgurl[i_image2]+"' target='_blank'><img width='"+(imgwidth-i_loop)+"' height='"+imgheight+"' src='"+imgname[i_image2]+"' border='0'></a>" } i_loop=i_loop+step var timer=setTimeout("stretchimage()",speed) } else { clearTimeout(timer) changeimage() } } function changeimage() { i_loop=0 i_image1++ if (i_image1>imgname.length-1) {i_image1=0} i_image2=i_image1-1 if (i_image2>imgname.length-1) {i_image2=0} if (i_image2<0) {i_image2=imgname.length-1} document.all.imgcontainer2.style.posLeft=document.all.imgcontainer1.style.posLeft var timer=setTimeout("stretchimage()",pause) } function initiate() { if (document.all) { document.all.imgcontainer1.style.posLeft=pos_left document.all.imgcontainer2.style.posLeft=pos_left document.all.imgcontainer1.style.posTop=pos_top document.all.imgcontainer2.style.posTop=pos_top changeimage() } if (document.layers) { document.imgcontainer1.left=pos_left document.imgcontainer2.left=pos_left document.imgcontainer1.top=pos_top document.imgcontainer2.top=pos_top rotatenetscape() } } function rotatenetscape() { document.imgcontainer1.document.write("<a href='"+imgurl[i_image1]+"' target='_blank'><img src='"+imgname[i_image1]+"' border='0'></a>") document.imgcontainer1.document.close() i_image1++ if (i_image1>imgname.length-1) {i_image1=0} var timer=setTimeout("rotatenetscape()",pause*2) } // - End of JavaScript - --> </script>
<body bgcolor="#FFFFFF" text="000000" link="0000FF" alink="0000FF" vlink="0000FF" onLoad="initiate()"> <span id="imgcontainer1" style="position:absolute"></span> <span id="imgcontainer2" style="position:absolute"></span>