Español
<!-- http://www.downcodes.com --> <!-- bbs http://bbs.downcodes.com --> <!--把下列代码加到<BODY>区域中--> <SCRIPT> función morph(e,esperar,pasos,estilo,hecho){ if(e.morphing){ return; } e.morphing = verdadero; e.paso = 0; e.hecho = pasos; e.esperar = esperar; e.morphDone = hecho; var atributos = _eat_attrib(estilo); if(attribs["top"] != null){ e.deltaTop = Math.round(Number((attribs["top"] - e.style.posTop) / pasos)); e.finalTop = atributos["arriba"]; }else{ e.deltaTop = nulo; e.finalTop = e.style.posTop; } if(attribs["left"] != null){ e.deltaLeft = Math.round(Number((attribs["left"] - e.style.posLeft) / pasos)); e.finalLeft = atributos["izquierda"]; }else{ e.deltaLeft = nulo; e.finalLeft = e.style.posLeft; } if(atributos["altura"] != null){ e.deltaHeight = Math.round(Number((atributos["altura"] - e.style.posHeight) / pasos)); e.finalHeight = atributos["altura"]; }else{ e.deltaHeight = nulo; e.finalHeight = e.style.posHeight; } if(attribs["ancho"] != null){ e.deltaWidth = Math.round(Number((attribs["ancho"] - e.style.posWidth) / pasos)); e.finalWidth = atributos["ancho"]; }else{ e.deltaWidth = nulo; e.finalWidth = e.style.posWidth; } e.colors = nueva matriz(); for(atrib en atributos){ if(attrib == "fondo"){ e.colors[e.colors.length] = new Array(); e.colors[e.colors.length - 1].nombre = atributo; e.colors[e.colors.length - 1].safename = attrib; } if(attrib == "color"){ e.colors[e.colors.length] = new Array(); e.colors[e.colors.length - 1].nombre = atributo; e.colors[e.colors.length - 1].safename = attrib; } if(attrib == "color-borde"){ e.colors[e.colors.length] = new Array(); e.colors[e.colors.length - 1].nombre = atributo; e.colors[e.colors.length - 1].safename = "borderColor"; } } for(var i=0;i<e.colors.length;i++){ var rgb = _eat_rgb(attribs[e.colors[i].nombre]); var prergb = _eat_rgb(e.style[e.colors[i].safename]); e.colors[i].delta = _eat_rgb(attribs[e.colors[i].nombre]); e.colors[i].finish = _eat_rgb(attribs[e.colors[i].nombre]); e.colors[i].delta["rojo"] = Math.round(Number((rgb["rojo"] - prergb["rojo"]) / pasos)); e.colors[i].delta["verde"] = Math.round(Number((rgb["verde"] - prergb["verde"]) / pasos)); e.colors[i].delta["azul"] = Math.round(Number((rgb["blue"] - prergb["blue"]) / pasos)); } setTimeout("_morphing(document.all." + e.id + ")", espera); } función _morphing(e){ e.step++; if(e.deltaTop!=null){ e.style.posTop += e.deltaTop; } if(e.deltaLeft!=null){ e.style.posLeft += e.deltaLeft; } if(e.deltaHeight!=null){ e.style.posHeight += e.deltaHeight; } if(e.deltaWidth!=null){ e.style.posWidth += e.deltaWidth; } for(var i=0;i<e.colors.length;i++){ var rgb = _eat_rgb(e.style[e.colors[i].safename]); e.style[e.colors[i].safename] = "rgb(" + (e.colors[i].delta["red"] + rgb["red"]) + "," + (e.colors [i].delta["verde"] + rgb["verde"]) + "," + (e.colors[i].delta["azul"] + rgb["azul"]) + ")"; } if(e.step == e.done){ if(e.deltaTop!= null) e.style.posTop = e.finalTop; if(e.deltaLeft!= null) e.style.posLeft = e.finalLeft; if(e.deltaWidth != null) e.style.posWidth = e.finalWidth; if(e.deltaHeight!= null) e.style.posHeight = e.finalHeight; for(var i=0;i<e.colors.length;i++){ e.style[e.colors[i].safename] = "rgb(" + (e.colors[i].finish["rojo" ] + rgb["rojo"]) + "," + (e.colors[i].finish["green"] + rgb["green"]) + "," + (e.colors[i].finish ["azul"] + rgb["azul"]) + ")"; } e.morphing = falso; eval(e.morphHecho); }else{ setTimeout("_morphing(document.all." + e.id + ")", e.wait); } devolver; } función _eat_attrib(str){ var fragmentos = new Array(); var todo = nueva matriz(); trozos=str.split(";"); for(var i=0;i<chunks.length;i++){ var tmpA = new Array(); tmpA=fragmentos[i].split(":"); todos[tmpA[0]]=tmpA[1]; } devolver todo; } función _eat_rgb(str){ var todo = new Array(); var a = str.indexOf("("); var b = str.indexOf(")"); cadena = cadena.subcadena(a + 1, b); var tmpA = str.split(","); todo["rojo"]=Número(tmpA[0]); todo["verde"]=Número(tmpA[1]); todo["azul"]=Número(tmpA[2]); devolver todo; } </SCRIPT><SPAN ID="prueba" STYLE="border:solid;border-width:5;border-color:rgb(0,0,0);color:rgb(255,255,255);position:absolute;top :0;izquierda:0;ancho:400;alto:400;desbordamiento:oculto;fondo:rgb(0,0,255);">想学网页制作技术,请到建站学院来! </SPAN> <SCRIPT> function rander(){ var top = Math.round(Math.random() * 400); var izquierda = Math.round(Math.random() * 600); ancho var = Math.round(Math.random() * 200); var altura = Math.round(Math.random() * 200); var r = Math.round(Math.random() * 255); var g = Math.round(Math.random() * 255); var b = Math.round(Math.random() * 255); var fondo = "rgb(" + r + "," + g + "," + b + ")"; var r = Math.round(Math.random() * 255); var g = Math.round(Math.random() * 255); var b = Math.round(Math.random() * 255); var borderColor = "rgb(" + r + "," + g + "," + b + ")"; var r = Math.round(Math.random() * 255); var g = Math.round(Math.random() * 255); var b = Math.round(Math.random() * 255); var color = "rgb(" + r + "," + g + "," + b + ")"; morph(document.all.test,30,20,"arriba:" + arriba + ";izquierda:" + izquierda + ";ancho:" + ancho + ";alto:" + alto + ";fondo:" + fondo + ";color-borde:" + colorborde + ";color:" + color + ";","rander();"); } rander(); </SCRIPT>