Codigos JAVA
ESTE ES EL CODIGO PARA TENER GOOGLE CON EL EFECTO DE MAC
Este código crea unos botones de navegación: atrás, arriba y adelante
Ejemplo
No podrás probarlos aquí por que no hay el antes y el siguiente peor si puedes bajar un poco la página y probar el de arriba.
También puedes usar solo el botón Top para subir arriba de cada página.
Lo puedes pegar tantas veces quieras en la misma página.
Copia y Pega el código como "Pegado especial" como "Tratar como HTML" en la vista Normal
CODIGO:
<!-- Búsqueda Google --> <center> <FORM method=GET action="http://www.google.com/search"> <TABLE bgcolor="#FFFFFF"><tr><td> <A HREF="http://www.google.com/" _fcksavedurl="http://www.google.com/"> <IMG SRC="http://www.google.com/logos/Logo_40wht.gif" _fcksavedurl="http://www.google.com/logos/Logo_40wht.gif" border="0" ALT="Google" align="absmiddle"></A> <INPUT TYPE=text name=q size=31 maxlength=255 value=""> <INPUT TYPE=hidden name=hl value=es> <INPUT type=submit name=btnG VALUE="Búsqueda Google"> </td></tr></TABLE> </FORM> </center> <!-- Búsqueda Google -->
Texto que sigue al raton:
<html> <head> <style> .spanstyle { position:absolute; visibility:visible; top:-50px; font-size:9pt; font-family:Tahoma; font-weight:bold; color:blue; } </style> <script> var x,y var step=20 var flag=0 // Tienes que dejar un espacio al final de tu mensaje!!!!! var message="Tu mensaje va aqui... " message=message.split("") var xpos=new Array() for (i=0;i<=message.length-1;i++) { xpos[i]=-50 } var ypos=new Array() for (i=0;i<=message.length-1;i++) { ypos[i]=-50 } function handlerMM(e){ x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY flag=1 } function makesnake() { if (flag==1 && document.all) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("span"+(i)+".style") thisspan.posLeft=xpos[i] thisspan.posTop=ypos[i] } } else if (flag==1 && document.layers) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i] thisspan.top=ypos[i] } } var timer=setTimeout("makesnake()",30) } </script> </head> <body onLoad_fckprotectedatt=" onLoad="makesnake()"" style="width:100%;overflow-x:hidden;overflow-y:scroll"> </body> <script> <!-- Beginning of JavaScript - for (i=0;i<=message.length-1;i++) { document.write("<span id='span"+i+"' class='spanstyle'>") document.write(message[i]) document.write("</span>") } if (document.layers){ document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = handlerMM; // - End of JavaScript - --> </script> </html>
Texto que cambia de color:
<script language="JavaScript"> <!-- function initArray() { for (var i = 0; i < initArray.arguments.length; i++) { this[i] = initArray.arguments[i]; } this.length = initArray.arguments.length; } // you may fill this colors array with your colors. // the script will rotate the links through these colors var colors = new initArray( "#0066FF", "#FF6600", "blue", "red", "purple", "black", "grey", "navy"); pause_time = .5; // in seconds link = 0; // starting color index (in colors array) for unvisited links vlink = 4; // starting color index (in colors array) for visited links function linkDance() { link = (link+1)%colors.length; vlink = (vlink+1)%colors.length; //alert("link "+link+"rnvlink "+vlink+"rnvlinkColor "+document.vlinkColor); document.linkColor = colors[link]; document.vlinkColor = colors[vlink]; setTimeout("linkDance();",pause_time*1000); } linkDance(); // --> </script>
Texto en cursiva:
[i]Cursiva[/i]
Texto superindice:
<sup>superindice</sup>
Texto tachado:
<strike>tachado</strike>
Texto subrayado:
<u>subrayado</u>
Girar el texto orizontalmente:
<span style="filter: fliph; height:1">Code Web</span>
Camgiar tamaño del texto:
<font size='5'>Texto Gigante</font>
Titulo en movimiento:
<SCRIPT LANGUAGE="JavaScript"> var txt=" [ C O D E S W E B ] - http://www.team-webmaster.es.tl -"; var espera=200; var refresco=null; function rotulo_title() { document.title=txt; txt=txt.substring(1,txt.length)+txt.charAt(0); refresco=setTimeout("rotulo_title()",espera);} rotulo_title(); </SCRIPT>
Texto a la izquierda:
<div align="left">texto</div>
Texto a la derecha:
<div align="right">texto</div>
Palabras en movimiento:
<SCRIPT languague="JavaScript"> <!-- var cuenta=0 var texto=" Siempre deja espacio " function scrolltexto () { window.status=texto.substring (cuenta,texto.length)+ texto.substring(0,cuenta) if (cuenta <texto.length){ cuenta ++ }else{ cuenta=0 } setTimeout("scrolltexto()",150) } scrolltexto () //--> </SCRIPT>
Texto maquina de escribir:
<tt>modo maquina</tt>
Hora en la barra superior 1:
<SCRIPT Language="JavaScript"> <!-- var today = new Date() var year = today.getYear() if(year<1000) year+=1900 document.title="Titulo de la pagina "+"("+today.getDate() + "." + (today.getMonth()+1) + "." + (year+"").substring(2,4)+")" //--> </SCRIPT> </head>
<
Texto imborrable:
<input type=text name=box value="No lo puedes borrar" onFocus_fckprotectedatt=" onFocus="this.blur()"" size=22>
Texto aleatorio:
<Script Language="JavaScript"> hoje = new Date() numero_de_textos = 4 segundos = hoje.getSeconds() numero = segundos % numero_de_textos if (numero == 0){ texto = "Coloca el primer texto aquí" } if (numero == 01){ texto = "Coloca el segundo texto aquí" } if (numero == 02){ texto = "Coloca el tercer texto aquí" } if (numero == 03){ texto = "Coloca el cuarto texto aquí" } document.write('' + texto +'') </script>
Impocible seleccionar texto:
<script language="JavaScript"> function disableselect(e) { return false } function reEnable() { return true } //if IE4+ document.onselectstart=new Function ("return false") //if NS6 if (window.sidebar) { document.onmousedown=disableselect document.onclick=reEnable } </script> </head>
Barra de estado animada:
<script language="JavaScript"> tempo = 10; chars = 5; texto = "-- Bievenidos a team-webmaster --"; wtexto = new Array(33); wtexto[0] = texto; blnk = " ";//Mantén estos espacios for (i = 1; i < 32; i++) { b = blnk.substring(0, i); wtexto[i] = ""; for (j = 0; j < texto.length; j++) wtexto[i] = wtexto[i] + texto.charAt(j) + b; } function animastatus() { if (chars > -1) str = wtexto[chars]; else str = wtexto[0]; if (chars-- < -40) chars = 31; status = str; clearTimeout(tempo); tempo = setTimeout("animastatus()", 150); } animastatus() </script>
Texto fantasma:
<span style="height: 1; Filter: Alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, FinishX=100%)">Codes web</span>
Texto en negrita:
[b]Negrita[/b]
Texto subindice:
<sub>subindice</sub>
Texto ondulado:
<table style="Filter: Wave(Add=0, Freq=2, LightStrength=10, Phase=3, Strength=3)">Codes web</table>
Texto sombreado:
span style="height: 20;filter:blur(add=1,direction=270,strength=10)">team-webmaster</span>
Girar texto verticalmente:
<span style="filter: flipv; height:1">Codes web</span>
Texto deslisante hacia arriba:
<marquee behavior=scroll direction=up scrollamount=1 height=60>Codes web</marquee>
Texto al centro:
<div align="center">texto</div>
Poner mensaje en la barra:
<SCRIPT LANGUAGE=JavaScript> window.defaultStatus = "Saludos de Codes web"; </SCRIPT>
Texto flotando en la pantalla:
<script language="JavaScript"> <!-- done = 0; step = 4 function anim(yp,yk) { if(document.layers) document.layers["texto"].top=yp; else document.all["texto"].style.top=yp; if(yp>yk) step = -4 if(yp<60) step = 4 setTimeout('anim('+(yp+step)+','+yk+')', 35); } function start() { if(done) return done = 1; if(navigator.appName=="Netscape") { document.texto.left=innerWidth/2 - 145; anim(60,innerHeight - 60) } else { texto.style.left=11; anim(60,document.body.offsetHeight - 60) } } // --></script> <div id="texto" style="position: absolute; top: -50; color: #FF8000; font-family: Arial, Helvetica; font-weight:bold; font-size:40px;"> <p><font face="Arial, Helvetica, sans-serif" size="3"><b><font size="6" color="#990000">Saludos de team-webmaster;/font></b></font></p> </div> <script language="JavaScript"> <!-- setTimeout('start()',10); //--> </script>
Texto que cambia de color:
<html> <head> <style> .bigChange {color:blue; font-weight:bolder; font-size:175%; letter-spacing:4px; text-transform: uppercase; background:yellow} .start {color:yellow; background:blue} </style> <script LANGUAGE="JAVASCRIPT"> function highlightButton(s) { if ("INPUT"==event.srcElement.tagName) event.srcElement.className=s } </script> <title>JavaFILE</title> <base target="leftframe"></base> </head> <body BGCOLOR="#ffffff" link="#CC0033" vlink="#333399" alink="#FF0000" <!--content start--> <table WIDTH="96%" BORDER="0" CELLSPACING="5" CELLPADDING="5"> <tr> <td WIDTH="100%"><font size="3"></font><font FACE="ARIEL,HELVETICA" SIZE="-1"><form NAME="highlight" onmouseover_fckprotectedatt=" onmouseover="highlightButton('start')"" onmouseout_fckprotectedatt=" onmouseout="highlightButton('')""> <div align="center"><center><p><input type="button" Value="Presioname...Cambiaré de color!"></font></p> </center></div> </form> </td> </tr> </table> <!--content stop--> </body> </html>
Evitar subrayado de link:
<html> <head> <title>No Link Lines!</title> <!-- START NO LINK LINE CODE --> <!-- This ENTIRE script goes between your HEAD tags. --> <style> <!-- a{text-decoration:none} //--> </style> <!-- END NO LINK LINE CODE --> </head> <body> <!-- YOUR SITE CONTENT GOES HERE --> </body> </html>
Frases desplasandoce en la barra:
<html> <head> <SCRIPT> <!-- var ShowString = " " //La primera linea tiene que estar en blanco + "Aqum la frase 1 " //Puedes añadir mas frases, aparte de estas 3 + "Aqum la frase 2 " + "Aqum la frase 3 " + "Ejemplo de otra frase " var ShowWidth = 100 var ShowHead = 0 var ShowTail = ShowWidth var ShowLength = ShowString.length function Marquee () { var DisplayString if (ShowHead < ShowTail) DisplayString = ShowString.substring(ShowHead, ShowTail) else DisplayString = ShowString.substring(ShowHead, ShowLength) + ShowString.substring( 0, ShowTail) ShowHead = (ShowHead + 1 ) % ShowLength ShowTail = (ShowTail + 1 ) % ShowLength window.status = DisplayString TimerID = setTimeout("Marquee()", 100) //Cambia el numero para cambiar la velocidad } //--> </SCRIPT> </head> <BODY onLoad_fckprotectedatt=" onLoad="Marquee()""> </body> </html>
Ventana con texto movil:
<script language="JavaScript1.2"> // ancho var marqueewidth=200 // alto var marqueeheight=120 // velocidad var speed=2 // contenido var marqueecontents='<font face="Verdana"><small>agrega noticias, etc</a><br>www.team-webmaster.es.tl, puedes cambiar el color de fondo la fuente</a><br>Incluye aqui mas info</a><br>Modifica este script para tu uso</a></small></a></font>' if (document.all) document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>') function regenerate(){ window.location.reload() } function regenerate2(){ if (document.layers){ setTimeout("window.onresize=regenerate",400) intializemarquee() } } function intializemarquee(){ document.cmarquee01.document.cmarquee02.document.write(marqueecontents) document.cmarquee01.document.cmarquee02.document.close() thelength=document.cmarquee01.document.cmarquee02.document.height scrollit() } function scrollit(){ if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){ document.cmarquee01.document.cmarquee02.top-=speed setTimeout("scrollit()",100) } else{ document.cmarquee01.document.cmarquee02.top=marqueeheight scrollit() } } window.onload=regenerate2 </script>
Fecha el la barra superior 2:
<script language="javascript"> var fecha = new Date() var anho = fecha.getYear() if(anho < 1000) anho+=1900 var mes = fecha.getMonth() var dia = fecha.getDate() if(dia < 10) dia = "0" + dia var mesarray = new Array("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic") document.title ="Titulo de la pagina (" +dia+ "/" +mesarray[mes]+ "/" +anho+ ")" </script> </head>
Evitar copiar texto:
<!-- www.team-webmaster.es.tl--> <script language="JavaScript1.2"> function disableselect(e){ return false } function reEnable(){ return true } //if IE4+ document.onselectstart=new Function ("return false") //if NS6 if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } </script>
Imagen volando por la pantalla:
Este efecto hace que cualquier imagen que elijas quede "paseando" por la pantalla, siendo un recurso excelente tanto para llamar la atención por alguna novedad en tu sitio como para darle más movimiento a la página.
Copiá y pegá el siguiente código en tu página HTML.
Recordá que la imagen debe estar en el mismo directorio de tu página html.
<SCRIPT language="JavaScript1.2"> var imagem="Ingresa el nombre del archivo de imagen aquí" if (document.layers) {document.write("<LAYER NAME='animacao' LEFT=10 TOP=10><img src='"+imagem+"' ></LAYER>")} else if (document.all){document.write("<div id='animacao' style='position:absolute;top:10px;left:10px;width:17px;height:22px;z-index:50'><img src='"+imagem+"'></div>")} conta=-1; move=1; function curva(){ abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6) for (i=0; i < abc.length; i++) {var C=Math.round(Math.random()*[i])} iniciar=abc[C]; setTimeout('curva()',1900); return iniciar; } ypos=10; xpos=10; movimento = 60; function moveR(){ caminho=movimento+=iniciar; y = 4*Math.sin(caminho*Math.PI/180); x = 6*Math.cos(caminho*Math.PI/180); if (document.layers){ ypos+=y; xpos+=x; document.animacao.top=ypos+window.pageYOffset; document.animacao.left=xpos+window.pageXOffset; } else if (document.all){ ypos+=y; xpos+=x; document.all.animacao.style.top=ypos+document.body.scrollTop; document.all.animacao.style.left=xpos+document.body.scrollLeft; } T=setTimeout('moveR()',50); } function edges(){ if (document.layers){ if (document.animacao.left >= window.innerWidth-40+window.pageXOffset)movimento=Math.round(Math.random()*45+157.5); if (document.animacao.top >= window.innerHeight-30+window.pageYOffset)movimento=Math.round(Math.random()*45-112.5); if (document.animacao.top <= 2+window.pageYOffset) movimento = Math.round(Math.random()*45+67.5);//OK! if (document.animacao.left <= 2+window.pageXOffset) movimento = Math.round(Math.random()*45-22.5);//OK! } else if (document.all) { if (document.all.animacao.style.pixelLeft >= document.body.offsetWidth-45+document.body.scrollLeft)movimento=Math.round(Math.random()*45+157.5); if (document.all.animacao.style.pixelTop >= document.body.offsetHeight-35+document.body.scrollTop)movimento=Math.round(Math.random()*45-112.5); if (document.all.animacao.style.pixelTop <= 2+document.body.scrollTop) movimento = Math.round(Math.random()*45+67.5);//OK! if (document.all.animacao.style.pixelLeft <= 2+document.body.scrollLeft) movimento = Math.round(Math.random()*45-22.5);//OK! } setTimeout('edges()',100); } function efeito(){ curva(); moveR();// onUnload="opener.gO()" edges(); } if (document.all||document.layers) efeito() </script>
Redireccionar una página:
Si tenés una dirección larga, y los servidores que te dan direcciones cortas no tienen buena capacidad de almacenamiento o de taza de transferencia de datos, con este código podés hacer que al escribir una dirección se abra otra, solo tenés que insertar este código en el index.html del dominio corto poniendo tu dirección actual:
Código HTML:
<HTML> <HEAD> <TITLE>Redireccionado por www.tuweb.com</TITLE> <SCRIPT LANGUAGE="JavaScript"> location.href='http://www.tuweb.com'; </SCRIPT> </HEAD> <BODY>
Nota: este codigo lo puedes pegar en cualquier parte
No dejar seleccionar el texto de nuestra Web:
Con este código vamos a impedir que los visitantes seleccionen el texto de nuestra página para luego copiarlo a otro lado.
Nota: este codigo lo pegan en cualquier box
<script language="Javascript"> <!-- Begin function disableselect(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=disableselect document.onclick=reEnable } // End --> </script>
Horas restantes para finalizar el día:
Con este código insertamos un pequeño relojito que indica la cuenta regresiva de las horas, minutos y segundos que faltan para finalizar el día.
<p>El reloj...</p> <form name="Reloj"> <input type="text" size="7" name="tiempo" value="mm:hh:ss" title="Tiempo restante para finalizar el día"> <script language="JavaScript"> <!-- var tiempoAtras; updateReloj(); function updateReloj() { var tiempo = new Date(); var hora = 23-tiempo.getHours(); var minutos = 59-tiempo.getMinutes(); var segundos = 59-tiempo.getSeconds(); tiempoAtras= (hora < 10) ? hora :hora; tiempoAtras+= ((minutos < 10) ? ":0" : ":") + minutos; tiempoAtras+= ((segundos < 10) ? ":0" : ":") + segundos; document.Reloj.tiempo.value = tiempoAtras; setTimeout("updateReloj()",1000); } //--> </script> </form> </body> <
Efecto Burbujas
Descripció n: Agregue a su web un efecto animado de burbujas que flotan hacia arriba y luego desaparecen.
Demo: Mire la pantalla...
Instrucciones
Paso 1: Guarde y suba la siguiente imágen al directorio de su web (click derecho del mouse y elegir "Guardar imagen como..."):
<script language="JavaScript1.2"> <!-- Begin /****************************************** * Burbujas Script - HTML.Dynamico 2001 * Mas Scripts y Recursos para tu web en: * http://www.htmldynamico.cjb.net ******************************************/ var no = 15; // image number or falling rate var speed = 2; // the lower the number the faster the image moves var snow = new Array(); snow[0] = "bubble.gif" snow[1] = "bubble.gif" snow[2] = "bubble.gif" var ns4up = (document.layers) ? 1 : 0; // browser sniffer var ie4up = (document.all) ? 1 : 0; var ns6up = (document.getElementById&&!document.all) ? 1 : 0; var dx, xp, yp; // coordinate and position variables var am, stx, sty; // amplitude and step variables var i, doc_width = 800, doc_height = 1800; if (ns4up||ns6up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); j = 0; for (i = 0; i < no; ++ i) { dx[i] = 0; // set coordinate variables xp[i] = Math.random()*(doc_width-50); // set position variables yp[i] = Math.random()*doc_height; am[i] = Math.random()*20; // set amplitude variables stx[i] = 0.02 + Math.random()/10; // set step variables sty[i] = 0.7 + Math.random(); // set step variables if (ns4up) { // set layers if (i == 0) { document.write("<layer name="dot"+ i +"" left="15" top="15" visibility="show"><img src=""+ snow[j] + "" border="0"></layer>"); } else { document.write("<layer name="dot"+ i +"" left="15" top="15" visibility="show"><img src=""+ snow[j] + "" border="0"></layer>"); } } else if (ie4up||ns6up) { if (i == 0) { document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;"><img src="" + snow[j] + "" border="0"></div>"); } else { document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;"><img src="" + snow[j] + "" border="0"></div>"); } } if (j == (snow.length-1)) { j = 0; } else { j += 1; } } function snowNS() { // Netscape main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] -= sty[i]; if (yp[i] < -50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = doc_height; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]+pageYOffset; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", speed); } function snowIE_NS6() { // IE main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] -= sty[i]; if (yp[i] < -50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = doc_height; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = ns6up?window.innerWidth-5:document.body.clientWidth; doc_height = ns6up?window.innerHeight-5:document.body.clientHeight; } dx[i] += stx[i]; if (ie4up){ document.all["dot"+i].style.pixelTop = yp[i]+document.body.scrollTop; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } else if (ns6up){ document.getElementById("dot"+i).style.top=yp[i]+pageYOffset; document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]); } } setTimeout("snowIE_NS6()", speed); } if (ns4up) { snowNS(); } else if (ie4up||ns6up) { snowIE_NS6(); } // End --> </script>
Cambio de color de fondo
Intro que al pasar el mouse cambia la imagen
Codigo
<body style="background-color: rgb(30, 30, 30);">
<center>
<style type="text/css">
<!--
a
{
outline: none;
}
-->
</style>
<script language="JavaScript">
aus1 = new Image();
aus1.src = "http://pixelea.com/s/acee665b44.png";
an1 = new Image();
an1.src = "http://pixelea.com/s/34b42e9d65.png";
</script><a href="Link,Url "><img alt="" name="a1" onmouseover="a1.src='http://pixelea.com/s/34b42e9d65.png';" onmouseout="a1.src='http://pixelea.com/s/acee665b44.png';" src="http://pixelea.com/s/acee665b44.png" border="0"></a></center>