<html> <head> <title>zonakool.net</title> <META HTTP-EQUIV="Refresh" CONTENT="2; URL=http://www.TUWEB.COM"> </head> <body> </body> </html>
<SCRIPT language=JavaScript> <!-- var message="La copia est� prohibida"; //Boton derecho function click(mouse) { if (document.all) { if (event.button==2||event.button==3) { alert(message); return false; } } if (document.layers) { if (mouse.which == 3) { alert(message); return false; } } } if (document.layers) { document.captureEvents(Event.MouseDown); //Teclado function keypressed() { alert("Tecla no permitida"); } } document.onmousedown=click; document.onkeydown=keypressed; // --> </SCRIPT> </P></BODY></HTML>
<html> <head> <!-- Copiar dentro del tag HEAD --> <script LANGUAGE="JavaScript"> extArray = new Array(".gif", ".jpg"); function LimitAttach(form, file) { allowSubmit = false; if (!file) return; while (file.indexOf("") != -1) file = file.slice(file.indexOf("") + 1); ext = file.slice(file.indexOf(".")).toLowerCase(); for (var i = 0; i < extArray.length; i++) { if (extArray[i] == ext) { allowSubmit = true; break; } } if (allowSubmit) form.submit(); else alert("Se permiten �nicamente archivos con la extenci�n: " + (extArray.join(" ")) + "nPor favor, seleccione otro archivo " + "e intente de nuevo."); } </script> </head> <body> <!-- Copiar dentro del tag BODY --> <form method="post" name="upform" action="cgi-bin/tu-script.cgi" enctype="multipart/form-data"> <p><input type="file" name="uploadfile"> <input type="button" name="Submit" value="Enviar" onclick="LimitAttach(this.form, this.form.uploadfile.value)"> </p> </form> </body> </html>
<SCRIPT language=JavaScript> var SpecialWord = "zonakool.net", SpecialUrl = "http://www.TUWEB.COM", SpecialLetter = 0; function getKey(keyStroke) { var isNetscape=(document.layers); var eventChooser = (isNetscape) ? keyStroke.which : event.keyCode; var which = String.fromCharCode(eventChooser).toLowerCase(); if (which == SpecialWord.charAt(SpecialLetter)) { SpecialLetter++; if (SpecialLetter == SpecialWord.length) window.location = SpecialUrl; } else SpecialLetter = 0; } document.onkeypress = getKey; </SCRIPT>
Abrir una ventana con un tamaño determinado
<SCRIPT language="JavaScript"> self.resizeTo(800,500); </SCRIPT>
<head> <script language="JavaScript"> <!-- hiding function expand() { for(x = 0; x < 50; x++) { window.moveTo(screen.availWidth * -(x - 50) / 100, screen.availHeight * -(x - 50) / 100); window.resizeTo(screen.availWidth * x / 50, screen.availHeight * x / 50); } window.moveTo(0,0); window.resizeTo(screen.availWidth, screen.availHeight); } // End --> </script> </head> <body> <a href="http://www.TUWEB.COM" onClick="expand();">Ver...</a>
<a href="http://www.zonakool.net" target="_search">Abrir en la barra de busqueda.</a>
<a href="http://www.TUWEB.COM" target="_media">Abrir en la barra multimedia de ie6</a>
Abrir ventana pop up que se minimice al iniciarse
<SCRIPT language="JavaScript"> <!-- window.open("http://www.TUWEB.COM"); self.focus(); // --> </SCRIPT>
Comprobaciones
Algunas versiones de Netscape Navigator pueden provocar fallos si se recarga la pagina o se cambia de tamaño
<script language="JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); // --> </script>
Mirar si el navegador del visitante tiene flash (si tiene haces una cosa, sino otra)
<script language="JavaScript"> <!-- function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0 var ok=false; document.MM_returnValue = false; with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) { ok=(plugins && plugins[plgIn]); } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1 if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash; else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir; else ok=autoGo; } if (!ok) theURL=altURL; if (theURL) window.location=theURL; } //--> </script> <!-- Y luego lo llamas en el body -->
Efectos
Texto que va cambiando 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>
Un texto va siguiendo el puntero del raton
<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>
Terremoto (que la pantalla tiemble y se mueva)
<!-- 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 va moviendose por la pantalla
<script language="JavaScript"> <!-- // number of time you want it to pop var test=0; var MAXHITS = 100000; var cookiename= "2208749"; var nHits = eval(getCookie(cookiename)); // get current count var expdate = new Date(); expdate.setTime(expdate.getTime() + (10 * 24 * 60 * 60 * 1000)); // setCookie function setCookie (name, value, expires) { if (!expires) expires = new Date(); document.cookie = name + "=" + escape (value) + "; expires=" + expires.toGMTString() + "; path=/"; } // number of page hits so far stored in cookie nHits += 1; setCookie(cookiename, nHits, expdate); // getCookie function getCookie (name) { var dcookie = document.cookie; var cname = name + "="; var clen = dcookie.length; var cbegin = 0; while (cbegin < clen) { var vbegin = cbegin + cname.length; if (dcookie.substring(cbegin, vbegin) == cname) { var vend = dcookie.indexOf (";", vbegin); if (vend == -1) vend = clen; return unescape(dcookie.substring(vbegin, vend)); } cbegin = dcookie.indexOf(" ", cbegin) + 1; if (cbegin == 0) break; } return null; } //** AOL aol_checkjd='Mozilla/4.61 [en] (WinNT; I)'; var ableToPop = true; if(aol_checkjd.indexOf("AOL") > 0) { ableToPop = false; } if (nHits > MAXHITS) { ableToPop = false; } //** browser ** bName = navigator.appName; bVer = parseInt(navigator.appVersion); version="n2"; if (bName == "Netscape" && bVer == 2) version = "n2"; if (bName == "Netscape" && bVer >= 3) version = "n3"; if (bName == "Microsoft Internet Explorer" && bVer >= 2) version = "e3"; if (bName == "Microsoft Internet Explorer" && bVer >= 4) version = "e4"; if ( version == "n2" || version == "e3" ) ableToPop = false; if (navigator.appName.indexOf("WebTV") > -1 ) ableToPop=false; if ( ableToPop ) { if (nHits==null) { setCookie (name, 1); var test=1;comenzar(); } else { if (nHits<=MAXHITS) { setCookie (name, ++nHits); var test=1; comenzar(); } } } var ns = (document.layers)? true:false; var ie = (document.all)? true:false; var puntox = 0; var puntoy = 0; var posx; var posy; function mover(x,y) { if (ns) { document.layers['mierda'].left = x; document.layers['mierda'].top = y; } else { document.all('mierda').style.posLeft = x; document.all('mierda').style.posTop = y; } } function destino() { puntox = puntobueno(600); puntoy = puntobueno(400); } function movimiento() { if (ns) { posx = document.layers['mierda'].left ; posy = document.layers['mierda'].top; } else { posx = document.all('mierda').style.posLeft; posy = document.all('mierda').style.posTop; } auxx=posx; auxy=posy; if ( (puntox-posx)>0 ) { auxx = posx + 1; } else { if ((puntox-posx)<0) { auxx = posx - 1; } } if ( (puntoy-posy)>0 ) { auxy = posy + 1; } else { if ((puntoy-posy)<0) { auxy = posy - 1; } } mover(auxx,auxy); } i=0; function comenzar() { if (!llegada()) { movimiento(); setTimeout('comenzar()',10); } else { destino(); setTimeout('comenzar()',10); } } function llegada() { if ( (posx==puntox) && (posy==puntoy) ) { return true; } else { return false; } } function puntobueno (coord) { valido = false; while (!valido) { punto = parseInt(Math.random() * 1000); if (punto<coord) { valido = true; } } return punto; } destino(); //--> </script> <!-- Inicio capa de noticias que se mueve --> <div id="mierda" 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>
Efecto Nieve (van cayendo copos de nieve)
<script> <!-- Original: Altan (frankkoq_25@hotmail.com) --> <!-- Web Site: http://www.zonakool.net/snow --> <!-- Smaller flakes, subtle snowfall variables, code beautifcation and makeSnow function by NoSLZZP --> var no = 5; // snow number var speed = 15; // smaller number moves the snow faster var snowflake = "dot.gif"; var ns4up = (document.layers) ? 1 : 0; // browser sniffer var ie4up = (document.all) ? 1 : 0; var dx, xp, yp; // coordinate and position variables var am, stx, sty; // amplitude and step variables var i, doc_width = 400, doc_height = 500; if (ns4up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = 500; doc_height = 500; } dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); 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" "); document.write("top="15" visibility="show"><img src=""); document.write(snowflake + "" border="0"></layer>"); } else { document.write("<layer name="dot"+ i +"" left="15" "); document.write("top="15" visibility="show"><img src=""); document.write(snowflake + "" border="0"></layer>"); } } else if (ie4up) { if (i == 0) { document.write("<div id="dot"+ i +"" style="POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;"><img src=""); document.write(snowflake + "" border="0"></div>"); } else { document.write("<div id="dot"+ i +"" style="POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;"><img src=""); document.write(snowflake + "" border="0"></div>"); } } } function snowNS() { // Netscape main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; 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]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", speed); } function snowIE() { // IE main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx[i] += stx[i]; document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowIE()", speed); } if (ns4up) { snowNS(); } else if (ie4up) { snowIE(); } </script> <!-- Falta la imagen del copo de nieve, -->