Español
<!-- 请将下面的原代码插入到<body>下面--> <script language="JavaScript"> <!-- /****** Cosas que puedes cambiar *****/ msg= "欢迎光临建站学院"; msgSize=4;//1-7 FoNt='Arial'; CoLoR='777777'; velocidad=2; /****** Cosas que no deberías cambiar *****/ ns=(document.layers)?1:0; msg=msg.split(''),cantidad=msg.length,Y=0,X=0,ypos=0,xpos=0,ybase=new Array(),xbase=new Array(); ángulo = nueva matriz(),divTop= nueva matriz(),divLeft=nueva matriz(); DocHeight=(document.layers)?window.innerHeight:window.document.body.offsetHeight; DocWidth=(document.layers)?window.innerWidth:window.document.body.offsetWidth; //¡colocación de capa inicial! for (i=0; i < cantidad; i++){ divTop[i]=Math.round(Math.random()*DocHeight); divLeft[i]=Math.round(Math.random()*DocWidth); } if (ns){ for (i = 0; i < cantidad; i++) {document.write('<nombre de capa=nsd'+i+' top=0 izquierda=0 ancho='+msgSize+' altura='+msgSize+ '><font face='+FoNt+' size='+msgSize+' color='+CoLoR+'>'+msg[i]+'</font></layer>');} window.captureEvents(Event.MOUSEMOVE ); función nsMouse(evnt){ ypos = evnt.pageY-20; xpos = evnt.pageX-10; } ventana.onMouseMove = nsMouse; } else{ document.write('<div id="hldr" style="position:absolute;top:0px;left:0px">') document.write('<div style="position:relative">') for (i=0; i < cantidad; i++) {document.write('<div id=ied style="position:absolute;top:0px;left:0px;width:'+msgSize+';height:'+msgSize+ '"><font face='+FoNt+' size='+msgSize+' color='+CoLoR+'>'+msg[i]+'</font></div>')} document.write('</ div></div>') función es decirMouse(){ ypos = event.y-20; xpos = evento.x-10; } document.onmousemove = es decirMouse; } función GoToMouse(){ var DocHeight=(document.layers)?window.innerHeight:window.document.body.offsetHeight; var DocWidth=(document.layers)?window.innerWidth:window.document.body.offsetWidth; var iscrll=(document.all)?document.body.scrollTop:0; var nscrll=(document.layers)?window.pageYOffset:0; if (!ns)hldr.style.top=iscrll; for (i=0; i < cantidad; i++){ Y = ypos - divTop[i]; X = xpos - divLeft[i]; ángulo[i] = Math.round(Math.atan2(Y,X) * 180/Math.PI); si (ángulo[i] < 0) ángulo[i] += 360; ybase[i]=Math.round(Math.random()*DocHeight); xbase[i]=Math.round(Math.random()*DocWidth); rep=Math.round(Math.random() * 3); extra=Math.round(Math.random() * 200) if (rep == 3)xbase[i] =-extra; if (rep == 2)xbase[i] =DocWidth+extra; si (rep == 1)ybase[i] =-extra; si (rep == 0)ybase[i] =DocHeight; y = Math.round(velocidad*Math.sin(ángulo[i]*Math.PI/180)); x = Math.round(velocidad*Math.cos(ángulo[i]*Math.PI/180)); divArriba[i]+=y; divIzquierda[i]+=x; if ((divLeft[i] > xpos-velocidad) && (divLeft[i] < xpos+velocidad/1.5) && (divTop[i] >= ypos-velocidad/1.5) && (divTop[i] <= ypos+velocidad /1.5)) {divTop[i]=ybase[i]+nscrll;divLeft[i]=xbase[i]} var capa=(document.layers)?document.layers['nsd'+i]:ied[i ].estilo; capa.top=divTop[i];layer.left=divLeft[i]; } S=setTimeout('GoToMouse()',10); } ventana.onload=GoToMouse; //--> </script>