Français
<!-- 把下列代码加到<head>区域中--> <script> Image0 = new Image(); Image0.src = "" ; Montant = 12 ; Ysouris = -50 ; Xsouris = -50 ; Ypos = nouveau tableau (); Xpos = nouveau tableau(); Vitesse = nouveau tableau (); taux = nouveau tableau (); grandir = nouveau tableau(); Étape = nouveau tableau (); Cstep = nouveau tableau(); nsSize = nouveau tableau(); ns = (document.layers)?1:0; (document.layers)?window.captureEvents(Event.MOUSEMOVE):0; function Souris(evnt) { Ymouse=(document.layers)?evnt.pageY-20:event.y-20; Xmouse=(document.layers)?evnt.pageX:event.x; } (document.layers)?window.onMouseMove=Souris:document.onmousemove=Souris; pour (i = 0; i < Montant; i++) { Ypos[i] = Ymouse; Xpos[i] = Xmouse; Vitesse[i] = Math.random()*4+1; Cétape[i] = 0 ; Étape[i] = Math.random()*0.1+0.05; grandir[i] = 8; nsSize[i] = Math.random()*15+5; taux[i] = Math.random()*0,5+0,1 ; } if (ns) { for (i = 0; i < Montant; i++) { document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+Image0. src+" name='N' width="+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 < Montant; i++) { document.write('<img id="si" src="'+Image0.src+'" style="position:absolute;top:0px;left:0px; filtre:alpha(opacité=90)">'); } document.write('</div></div>'); } function MouseBubbles() { var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop; var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft; pour (i = 0; i < Montant; i++){ sy = Vitesse[i] * Math.sin(270 * Math.PI / 180); sx = Vitesse[i] * Math.cos(Cstep[i] * 4); Ypos[i] += sy; Xpos[i] += sx; if (Ypos[i] < -40) { Ypos[i] = Ymouse ; Xpos[i] = Xmouse; Vitesse[i] = Math.random() * 6 + 4 ; grandir[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 = grandir[i]; si[i].style.height = grandir[i]; } grandir[i] += taux[i]; Cétape[i] += Étape[i]; si (grow[i] > 24) grow[i] = 25; } setTimeout('MouseBubbles()', 10); } Bulles de souris(); </script>