dasda
Usuario
Este es un DHTML que anima unas imagenes, en este caso aeroplanos que cruzan la pantalla en forma horizontal <script language="JavaScript1.2"> //Flying planes - by John Ely //Modified from: Autumn leaves script- by Kurt Grigg (kurt.grigg@virgin.net) //Modified by Dynamic Drive for NS6 functionality //visit http://www.dynamicdrive.com for this script //Pre-load your image below! //CHANGE 5 to the number of images listed below grphcs=new Array(5) //PRELOAD the involved images (extend or contract variables according to # of images used) Image0=new Image(); Image0.src=grphcs[0]="plane0.gif" Image1=new Image(); Image1.src=grphcs[1]="plane1.gif" Image2=new Image(); Image2.src=grphcs[2]="plane2.gif" Image3=new Image(); Image3.src=grphcs[3]="plane3.gif" Image4=new Image(); Image4.src=grphcs[4]="plane4.gif" //SPECIFY number of images to randomly display concurrently from list above. Less the more efficient Amount=3; Ypos=new Array(); Xpos=new Array(); Speed=new Array(); Step=new Array(); Cstep=new Array(); ns=(document.layers)?1:0; ns6=(document.getElementById&&!document.all)?1:0; ie=document.all if (ns){ for (i = 0; i < Amount; i++){ var P=Math.floor(Math.random()*grphcs.length); rndPic=grphcs; document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>"; } } else{ document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i = 0; i < Amount; i++){ var P=Math.floor(Math.random()*grphcs.length); rndPic=grphcs; document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">'); } document.write('</div></div>'); } WinHeight=(ns||ns6)?window.innerHeight-70:window.document.body.clientHeight; WinWidth=(ns||ns6)?window.innerWidth:window.document.body.clientWidth; for (i=0; i < Amount; i++){ Ypos = Math.round(Math.random()*WinHeight); Xpos = Math.round(Math.random()*WinWidth); Speed= Math.random()*5+1; Cstep=0; Step=Math.random()*0.1+0.05; } function fly(){ var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight; var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth; var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop; var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft; for (i=0; i < Amount; i++){ sy = Speed*Math.sin(Cstep); sx = Speed*2; Ypos+=sy; Xpos+=sx; if (Xpos > WinWidth){ Ypos=Math.round(Math.random()*WinHeight); Xpos=-60; Speed=Math.random()*5+1; } if (ns){ document.layers['sn'+i].left=Xpos+wscrll; document.layers['sn'+i].top=Ypos; } else if (ns6){ document.getElementById("si"+i).style.left=Xpos+wscrll; document.getElementById("si"+i).style.top=Math.min(WinHeight,Ypos); } else{ eval("document.all.si"+i).style.left=Xpos+wscrll; eval("document.all.si"+i).style.top=Ypos; } Cstep+=Step; } setTimeout('fly()',20); } if (ie||ns||ns6) window.onload=fly //--> </script> LINK: (con los modelos de los 6 aeroplanos) http://www.dynamicdrive.com/dynamicindex4/plane.zip Este script hace aparecer unos murcielagos rechotos pero la idea es que se pueda modificar para otra cosa la imagen usar la podemos hacer nosotros es un gif pedorro de 80x37.- <script language="JavaScript1.2"> <!-- /* Flying Bats- By Dynamic Drive, based on script by Kurt (kurt.grigg@virgin.net) For full source, usage terms, and 100's more DHTML scripts Visit http://www.dynamicdrive.com */ Cupid=new Image(); Cupid.src="bat.gif"; //specify path to bat image amount=3; //Number of cupids, minimum must be 3. Xpos=700; //cupids x coordinates, in pixel Ypos=200; //cupids y coordinates, in pixel step=0.3; //Animation speed (smaller is slower) dismissafter=15; //seconds after which Cupids should disappear, in seconds var ns6=document.getElementById&&!document.all bats=new Array(3) if (document.layers){ for (i=0; i < amount; i++) {document.write("<LAYER NAME=n"+i+" LEFT=0 TOP=-50><a href='http://www.dynamicdrive.com'><IMG SRC='"+Cupid.src+"' NAME='nsi' width=69 height=60 border=0></a></LAYER>"} } else if (document.all||ns6){ document.write('<div id="out" style="position:absolute;top:0;left:0"><div id="in" style="position:relative">'); for (i=0; i < amount; i++){ if (document.all) document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="msieBats" style="position:absolute;top:-50;left:0" border=0></a>') else document.write('<a href="http://www.dynamicdrive.com"><img src="'+Cupid.src+'" id="ns6Bats'+i+'" width=69 height=60 style="position:absolute;top:-50;left:0" border=0></a>') } document.write('</div></div>'); } yBase=xBase=currStep=a_count=0; b_count=1; c_count=2; d_count=3; move=1; if (document.layers||ns6){ yBase=window.innerHeight/3; xBase=window.innerWidth/6; if (document.layers) window.captureEvents(Event.MOUSEMOVE); } if (document.all){ yBase = window.document.body.offsetHeight/3; xBase = window.document.body.offsetWidth/6; } function dismisscupid(){ clearInterval(flycupid) if (document.layers){ for (i2=0; i2 < amount; i2++){ document.layers['n'+i2].visibility="hide" } } else if (document.all) document.all.out.style.visibility="hidden" else if (ns6) document.getElementById("out".style.visibility="hidden" } if (document.layers){ for (i=0; i < amount; i++) document.layers['n'+i].document.images['nsi'].src=Cupid.src } else if (document.all){ for (i=0; i < amount; i++) document.all.msieBats.src=Cupid.src } else if (ns6){ for (i=0; i < amount; i++) document.getElementById("ns6Bats"+i).src=Cupid.src } function Animate(){ a_count+=move; b_count+=move; c_count+=move; currStep+=step; if (a_count >= bats.length) a_count=0; if (b_count >= bats.length) b_count=0; if (c_count >= bats.length) c_count=0; if (document.layers){ for (i=0; i < amount; i++) { var NewL="n"+i document.layers.top = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/10) document.layers.left =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62) } } if (document.all){ for (i=0; i < amount; i++){ document.all.msieBats.style.pixelTop = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/10) document.all.msieBats.style.pixelLeft =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62) } } if (ns6){ for (i=0; i < amount; i++){ document.getElementById("ns6Bats"+i).style.top = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/10) document.getElementById("ns6Bats"+i).style.left =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62) } } } flycupid=setInterval('Animate()',30); setTimeout("dismisscupid()",dismissafter*1000) //--> </script> A LA CARITAS QUE APAREZCAN SUSTITUYANLAS CON ; ) JUNTOS LOS DOS SIGNOS Un scrolling de derecha a izquierda <script language="JavaScript1.2"> /* Left-Right scrolling window Script- © Dynamic Drive (www.dynamicdrive.com) For full source code, visit http://www.dynamicdrive.com/ This credit MUST stay intact for use */ //change speed to another integer to alter the scrolling speed. Greater is faster var speed=2 var currentpos=0,alt=1,curpos1=0,curpos2=-1 function initialize(){ startit() } function iecompattest(){ return (document.compatMode!="BackCompat"? document.documentElement : document.body } function scrollwindow(){ if (document.all) temp=iecompattest().scrollLeft else temp=window.pageXOffset if (alt==0) alt=1 else alt=0 if (alt==0) curpos1=temp else curpos2=temp if (curpos1!=curpos2){ if (document.all) currentpos=iecompattest().scrollLeft+speed else currentpos=window.pageXOffset+speed window.scroll(currentpos,0) } else{ currentpos=0 window.scroll(currentpos,0) } } function startit(){ setInterval("scrollwindow()",10) } window.onload=initialize </script> Hay una bocha, les dejo la pagina ojala les sirva , yo la verdad toco de oido. Fuente: http://www.dynamicdrive.com/