Cerrar la Ventana despues de un tiempo ****************************************************** <script language="javascript">setTimeout("self.close();",7000)</script>
Abre Una Nueva Ventana Despues de un Tiempo ******************************************************************* <script> var horizontal=12; setTimeout("abre()",3000); function abre() {window.open("http://weyx.iespana.es/"); } </script>
Boton de Adelante, Atras, actualizar **************************************************** <input type="button" value="Atrás" onclick="history.back()" style="font-family: Verdana; font-size: 8 pt"> <input type="button" value="Actualizar" onclick="window.location.reload()" style="font-family: Verdana; font-size: 8 pt"> <input type="button" value="Adelante" onclick="history.forward()" style="font-family: Verdana; font-size: 8 pt">
Auto Refresh ************** <!-- se refressca, se actualiza en tantos segundos --> <meta http-equiv="refresh" content="0"> <!-- va a hacia otra pagina en tantos segundos --> <meta http-equiv="refresh" content="8;URL=http://www.webrecurso.com">>
No Guarde el Navegador en el Cache *************************************************** <META HTTP-EQUIV="pragma" content="no-cache"> <!--si guarde cache --> <META HTTP-EQUIV="pragma" content="cache">
Rotacion de Banners ****************************** <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var how_many_ads = 3; var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) { txt="Una de las mejores webs"; url="http://www.webrecurso.com"; alt=":: Webrecurso.com ::"; banner="http://www.webrecurso.com/banner.gif"; width="468"; height="60"; } if (ad==2) { txt="Informática y videojuegos"; url="http://www.webrecurso.com/"; alt="webrecurso.com"; banner="http://etc, etc"; width="468"; height="60"; } if (ad==3) { txt="Webrecurso Recursos gratis para webmasters"; url="http://www.webrecurso.com/"; alt="webrecurso.com"; banner="http://"; width="468"; height="60"; } document.write('<center>'); document.write('<a href=\"' + url + '\" target=\"_blank\">'); document.write('<img src=\"' + banner + '\" width=') document.write(width + ' height=' + height + ' '); document.write('alt=\"' + alt + '\" border=0><br>'); document.write('<small>' + txt + '</small></a>'); document.write('</center>'); // End --> </SCRIPT>
Cambio de Banner Automatiko ******************************************* <!-- Dentro del tag HEAD --> <script LANGUAGE="JavaScript"> <!-- Comienza var mfBanners = [ ['http://www.banner1-url-here.com', 'ban1.gif'], ['http://www.banner2-url-here.com', 'ban2.gif'] ]; var mfIe = false; if( document.all) { mfIe = true; } var mfBannerIndex = 0; function mfBannerChange() { var htmlString = '< a target="_blank" href="'+mfBanners[mfBannerIndex][0]+'">< img border="0" src="'+mfBanners[mfBannerIndex][1]+'">< /a>'; if( mfIe) { document.all.banner.innerHTML = htmlString; } else { document.layers["banner"].document.open(); document.layers["banner"].document.write( htmlString); document.layers["banner"].document.close(); } if(mfBannerIndex mfBanners.length - 1) mfBannerIndex++; else mfBannerIndex = 0; } setInterval("mfBannerChange()", 3000); // End --> </script> <!-- Dentro del tag BODY --> <div id="banner"></div>
Enviar M@il con Subjekt *********************************** mailto:wey_x@hotmail.com.com?subject=Comentarios/Sugerencias
Validar Formulario ************************** <!-- para llamarlo --> <form method="post" action="http://www.tudominio.com/cgi-bin/formail.cgi" onSubmit="return validar(this.email.value)"> <!-- funcion --> <SCRIPT LANGUAGE="JavaScript"> function validar(direccion) { if (direccion.indexOf("@") != -1) return true; else { alert('Debes escribir una dirección de e-mail válida'); return false; } } </SCRIPT>
Validar Formularios Completos Permite Escribir Caracteres Prohibidos ************************************************** <!-- para llamarlo --> <form method="post" action="http://www.tudominio.com/cgi-bin/formail.cgi" onSubmit="return validar(this)"> <!-- funcion --> <script Language="JavaScript"><!-- function validar(formulario) { if (formulario.NOMBRE.value.length < 1) { alert("Escriba por lo menos 1 caracter en el campo \"nombre_usuario\"."); formulario.nombre_usuario.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚabcdefghijklmnñopqrstuvwxyzáéíóú "; var checkStr = formulario.nombre_usuario.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Escriba sólo letra caracteres en el campo \"nombre_usuario\"."); formulario.nombre_usuario.focus(); return (false); } if (formulario.APELLIDO.value.length < 10) { alert("Escriba una URL correcta en el campo \"web_actual\"."); formulario.web_actual.focus(); return (false); } if ((formulario.EMAIL.value.indexOf ('@', 0) == -1)||(formulario.email.value.length < 5)) { alert("Debes escribir una dirección de e-mail válida en el campo \"email\"."); formulario.email.focus(); return (false); } return (true); } //--></script>
Al Oprimir Boton Derecho, se Despliega un Menu ****************************************** <STYLE> <!-- .skin0{ position:absolute; width:175px; border:2px solid white; background-color:#C0C0C0; font-family:Verdana; font-size: 10px; line-height:15px; cursor:default; visibility:hidden; } .menuitems{ padding-left:10px; padding-right:10px; } --> </style> <script language="JavaScript1.2"> var menuskin=0 var display_url=0 function showmenuie5(){ var rightedge=document.body.clientWidth-event.clientX var bottomedge=document.body.clientHeight-event.clientY if (rightedge<ie5menu.offsetWidth) ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth else ie5menu.style.left=document.body.scrollLeft+event.clientX if (bottomedge<ie5menu.offsetHeight) ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight else ie5menu.style.top=document.body.scrollTop+event.clientY ie5menu.style.visibility="visible" return false } function hidemenuie5(){ ie5menu.style.visibility="hidden" } function highlightie5(){ if (event.srcElement.className=="menuitems"){ event.srcElement.style.backgroundColor="highlight" event.srcElement.style.color="white" if (display_url==1) window.status=event.srcElement.url } } function lowlightie5(){ if (event.srcElement.className=="menuitems"){ event.srcElement.style.backgroundColor="" event.srcElement.style.color="black" window.status='' } } function jumptoie5(){ if (event.srcElement.className=="menuitems"){ if (event.srcElement.getAttribute("target")!=null) window.open(event.srcElement.url,event.srcElement.getAttribute("target")) else window.location=event.srcElement.url } } </script> <!--[if IE]> <div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()"> <div class="menuitems" url="noticias.htm" target="_self">- Noticias</div> <div class="menuitems" url="dinero.htm" target="_self">- Encuesta</div> <div class="menuitems" url="index.htm" target="_self">- Mensajes SMS</div> <div class="menuitems" url="contacto.htm" target="_self">- Lista de Correo</div> <hr> <div class="menuitems" url="http://www.melodysoft.com/cgi-bin/foro.cgi?ID=AlexWebPage" target="_self">- Foro</div> <div class="menuitems" url="chat2.html" target="_self">- Webchat</div> <hr> <div class="menuitems" url="http://www.webrecurso.com/cgi-bin/birdcast.cgi" target="_self">- Recomendar</div> <div class="menuitems" url="formulario2.htm" target="_self">- Contactar</div> <div class="menuitems" url="bug.htm" target="_self">- ¿Algún fallo?</div> </div> <![endif]--> <script language="JavaScript1.2"> if (document.all&&window.print){ if (menuskin==0) ie5menu.className="skin0" else ie5menu.className="skin1" document.oncontextmenu=showmenuie5 document.body.onclick=hidemenuie5 } </script>
Texto k´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+"\r\nvlink "+vlink+"\r\nvlinkColor "+document.vlinkColor); document.linkColor = colors[link]; document.vlinkColor = colors[vlink]; setTimeout("linkDance();",pause_time*1000); } linkDance(); // --> </script>
Texto k´Sigue al Mous ****************** <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="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>
Terremoto en el Navegador *************************************** <!-- para llamarlo con un botón--> <INPUT onclick=shake(40) type=button value=""Terremoto""> <SCRIPT language=JavaScript1.2> <!-- Begin function shake(n) { if (n==1) {document.body.bgColor = "#0000DA"; } else {document.body.bgColor = "#FF8C00" } if (self.moveBy) { for (i = 15; i > 0; i--) { for (j = n; j > 0; j--) { self.moveBy(0,i); self.moveBy(i,0); self.moveBy(0,-i); self.moveBy(-i,0); } } } } // End --> </SCRIPT>
Cualquier Imagen Moviendose x la Pantalla *********************************************************** <!-- Inicio Noticias que se mueve --> <div id="webrecurso" style="position: absolute; left: 100; top: 242; width: 116; height: 58; z-index: 1"> <script> if (test) { document.write('<a href="noticias.htm" target="_blank"><img src="noticias.gif" border="0"></a>'); } </script> </div>
SIGUIENTE>>
<<ATRAS