Español
<!-- 把下列代码加到<head>区域中--> <script> Imagen0 = nueva Imagen(); Imagen0.src = ""; Cantidad = 12; Yratón = -50; Xmouse = -50; Ypos = nueva matriz(); Xpos = nueva matriz(); Velocidad = nueva matriz(); tasa = nueva matriz(); crecer = nueva matriz(); Paso = nueva matriz(); Cpaso = nueva matriz(); nsSize = nueva matriz(); ns = (documento.capas)?1:0; (documento.capas)?window.captureEvents(Event.MOUSEMOVE):0; function Mouse(evnt) { Ymouse=(document.layers)?evnt.pageY-20:event.y-20; Xmouse=(documento.capas)?evnt.pageX:event.x; } (document.layers)?window.onMouseMove=Ratón:document.onmousemove=Ratón; for (i = 0; i < Cantidad; i++) { Ypos[i] = Ymouse; Xpos[i] = Xmouse; Velocidad[i] = Math.random()*4+1; Cpaso[i] = 0; Paso[i] = Math.random()*0.1+0.05; crecer[i] = 8; nsSize[i] = Math.random()*15+5; tasa[i] = Math.random()*0.5+0.1; } if (ns) { for (i = 0; i < Cantidad; i++) { document.write("<NOMBRE DE CAPA='sn"+i+"' LEFT=0 TOP=0><img src="+Image0. src+" nombre='N' ancho="+nsSize[i]+" height="+nsSize[i]+"></LAYER>"); } } else { document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i = 0; i < Cantidad; i++) { document.write('<img id="si" src="'+Image0.src+'" style="position:absolute;top:0px;left:0px; filtro:alfa(opacidad=90)">'); } document.write('</div></div>'); } función MouseBubbles() { var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop; var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft; for (i = 0; i < Cantidad; i++){ sy = Velocidad[i] * Math.sin(270 * Math.PI / 180); sx = Velocidad[i] * Math.cos(Cpaso[i] * 4); Ypos[i] += sy; Xpos[i] += sx; if (Ypos[i] < -40) { Ypos[i] = Ymouse; Xpos[i] = Xmouse; Velocidad[i] = Math.random() * 6 + 4; crecer[i] = 8; nsSize[i] = Math.random() * 15 + 5; } if (ns) { document.layers['sn'+i].left = Xpos[i] + wscrll; document.layers['sn'+i].top = Ypos[i] + hscrll; } else { si[i].style.pixelLeft = Xpos[i] + wscrll; si[i].style.pixelTop = Ypos[i] + hscrll; si[i].style.width = crecer[i]; si[i].style.height = crecer[i]; } crecer[i] += tasa[i]; Cpaso[i] += Paso[i]; si (crecer[i] > 24) crecer[i] = 25; } setTimeout('MouseBubbles()', 10); } Burbujas de ratón(); </script>