Hola aqui les dejo algunos codigos Java espero que les gusten.
Cambiar el color de fondo cuando se carga la página:
<script>
function initArray()
{
this.length = initArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i]
}
var hexChars = "0123456789ABCDEF";
function Dec2Hex (Dec)
{
var a = Dec % 16;
var b = (Dec - a)/16;
hex = "" + hexChars.charAt(b) + hexChars.charAt(a);
return hex;
}
function CHANGEBG (begin, end, steps) { steps = steps -1 ;
redA = begin.charAt(0) + begin.charAt(1);
red_valA = parseInt(redA,'16');
redB = end.charAt(0) + end.charAt(1);
red_valB = parseInt(redB,'16');
red_int = ((red_valB - red_valA) / steps) * -1;
grnA = begin.charAt(2) + begin.charAt(3);
grn_valA = parseInt(grnA,'16');
grnB = end.charAt(2) + end.charAt(3);
grn_valB = parseInt(grnB,'16');
grn_int = ((grn_valB - grn_valA) / steps) * -1;
bluA = begin.charAt(4) + begin.charAt(5);
blu_valA = parseInt(bluA,'16');
bluB = end.charAt(4) + end.charAt(5);
blu_valB = parseInt(bluB,'16');
blu_int = ((blu_valB - blu_valA) / steps) * -1;
step = 2;
red = red_valA;
grn = grn_valA;
blu = blu_valA;
document.bgColor = begin;
while ( steps >= step )
{
red -= red_int;
red_round = Math.round(red);
red_hex = Dec2Hex(red);
grn -= grn_int;
grn_round = Math.round(grn);
grn_hex = Dec2Hex(grn);
blu -= blu_int;
blu_round = Math.round(blu);
blu_hex = Dec2Hex(blu);
document.bgColor = red_hex + grn_hex + blu_hex;
step++;
}
document.bgColor = end;
}
</script>
</HEAD><BODY>
<script>
<!--
CHANGEBG("FFFFFF","000000",350);
// -->
</script>
Mensaje al pasar el mouse por encima del texto :
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Los comentarios esconden el código a navegadores sin JavaScript
function Alarma() {
alert("No me pises, que llevo chanclas");
return true;
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<A HREF="eventos.html" onMouseOver="Alarma()">
Pasa por aquí encima
</A>
</BODY>
</HTML>
Proteger una página con contraseña :
Para tener este recurso en tu sitio debes incluir un código en la página de "entrada" en donde el visitante ingresará la clave, y enviar a tu sitio el archivo de la página que será cargada:
<Form name="frm">
<center>
<Script Language="JavaScript">
<!--
//
function loadpage(){
var psj=0;
newwin = window.open(document.frm.pswd.value + ".htm")
//window.location.href=document.frm.pswd.value + ".htm"
}
//-->
</script>
Ingresa tu clave:
<input
type="password" name="pswd" size="20">
</center>
<center>
<p>
<input type="button" value="Entra"
onClick="loadpage()" name="button">
</p>
</center>
</form>
Penalizar con un número de clicks al presionar 2 veces el botón derecho :
<script language="Javascript">
zaehler=0;
function right(e) {
if (navigator.appName == 'Netscape'){
if (e.which == 3 || e.which == 2){
alert("Aqui no puedes utilizar el botón derecho del mouse");
for(i=0;i!=zaehler;i++)alert("Ya te avisé, te penalizaré con n "+(zaehler-i)+"n clicks.");
zaehler+=10;
alert("¡La proxima vez que lo hagas será peor!");
return false;}}
if (navigator.appName == 'Microsoft Internet Explorer'){
if (event.button == 2 || event.button == 3){
alert("Aqui no puedes utilizar el botón derecho del mouse");
for(i=0;i!=zaehler;i++)alert("Ya te avisé, te penalizaré con n "+(zaehler-i)+"n clicks.");
zaehler+=10;
alert("¡La proxima vez que lo hagas será peor");
return false;}}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// --></script>
Imagen de cursor con estela :
<body>
<script language="JavaScript1.2">
<!--
var trailLength = 12 // Largo de la estela (8 por defecto)
var path = "cursor.gif" // Ubicación de la imágen
// No modificar
var isIE = false,isNav = false,range = "all.",style = ".style",i,d = 0
var topPix = ".pixelTop",leftPix = ".pixelLeft",images,storage
if (document.layers) { // identificador del browser
isNav = true,range = "layers.",style = "",topPix = ".top",leftPix = ".left"
} else if (document.all) {
isIE = true
}
function initTrail() { // preparar el script
images = new Array()
for (i = 0; i < parseInt(trailLength); i++) {
images[i] = new Image()
images[i].src = path
}
storage = new Array() // preparar coordinadas
for (i = 0; i < images.length*3; i++) {
storage[i] = 0
}
for (i = 0; i < images.length; i++) {
(isIE) ? document.write('<div id="obj' + i + '" style="position: absolute; z-Index: 100; height: 0; width: 0"><img src="' + images[i].src + '"></div>') : document.write('<layer name="obj' + i + '" width="0" height="0" z-index="100"><img src="' + images[i].src + '"></layer>')
}
trail()
}
function trail() { // Función de la estela
for (i = 0; i < images.length; i++) {
eval("document." + range + "obj" + i + style + topPix + "=" + storage[d])
eval("document." + range + "obj" + i + style + leftPix + "=" + storage[d+1])
d = d+2
}
for (i = storage.length; i >= 2; i--) {
storage[i] = storage[i-2]
}
d = 0
var timer = setTimeout("trail()",10)
}
function processEvent(e) {
if (isIE) { // para IE
storage[0] = window.event.y+document.body.scrollTop+10
storage[1] = window.event.x+document.body.scrollLeft+10
} else { // para Netscape Navigator
storage[0] = e.pageY+12
storage[1] = e.pageX+12
}
}
if (isNav) {
document.captureEvents(Event.MOUSEMOVE)
}
if (isIE || isNav) { // iniciar script
initTrail()
document.onmousemove = processEvent // comenzar captura
}
//-->
</script>
</body></textarea>
<br>
<br>
<br>
Fecha en la barra de estado
<br>
<br>
<br>
<textarea name="TextArea1" id="TextArea1" style="width:360px;height:58px;" rows="2" cols="34"><script language="javascript">
var hoy = new Date();
var anio = hoy.getYear();
var mName = hoy.getMonth() + 1;
var dName = hoy.getDay() + 1;
var diaNr = ((hoy.getDate()<10) ? "" : "") + hoy.getDate();
if(dName==1) Dia = "Domingo";
if(dName==2) Dia = "Lunes" ;
if(dName==3) Dia = "Martes";
if(dName==4) Dia = "Miércoles";
if(dName==5) Dia = "Jueves";
if(dName==6) Dia = "Viernes";
if(dName==7) Dia = "Sábado";
if(mName==1) Mes = "Enero" ;
if(mName==2) Mes = "Febrero";
if(mName==3) Mes = "Marzo" ;
if(mName==4) Mes = "Abril" ;
if(mName==5) Mes = "Mayo" ;
if(mName==6) Mes = "Junio" ;
if(mName==7) Mes = "Julio" ;
if(mName==
Mes = "Agosto";
if(mName==9) Mes = "Septiembre";
if(mName==10) Mes = "Octubre";
if(mName==11) Mes = "Noviembre";
if(mName==12) Mes = "Diciembre";
window.defaultStatus = "vete a la goma hoy ke estamos a " + Dia + " " + diaNr + " de " + Mes + " de " + anio
</script></textarea>
<br>
<br>
<br>
Fraze de tipo serpiente persigue a raton :
<br>
<br>
<br>
<textarea name="TextArea1" id="TextArea1" style="width:360px;height:58px;" rows="2" cols="34"><style>
.animado {position:absolute;visibility:visible;top:-50px;font-size:10pt;font-family:Arial;font-weight:bold;color:Blak;}
</style>
<script language=JavaScript>
var x,y
var tempo=10
var espera=0
var texto=" Coloca el texto aquí "
texto=texto.split("")
var xpos=new Array()
for (i=0;i<=texto.length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=texto.length-1;i++) {
ypos[i]=-50
}
function seguir(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
espera=1
}
function animar_cursor() {
if (espera==1 && document.all) {
for (i=texto.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+tempo
ypos[i]=ypos[i-1]
}
xpos[0]=x+tempo
ypos[0]=y
for (i=0; i<texto.length-1; i++) {
var camada = eval("span"+(i)+".style")
camada.posLeft=xpos[i]
camada.posTop=ypos[i]
}
}
else if (espera==1 && document.layers) {
for (i=texto.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+tempo
ypos[i]=ypos[i-1]
}
xpos[0]=x+tempo
ypos[0]=y
for (i=0; i<texto.length-1; i++) {
var camada = eval("document.span"+i)
camada.left=xpos[i]
camada.top=ypos[i]
}
}
var timer=setTimeout("animar_cursor()",30)
}
</script>
<script Language=JavaScript>
for (i=0;i<=texto.length-1;i++) {
document.write("<span id='span"+i+"' class='animado'>")
document.write(texto[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = seguir;
animar_cursor()
</script>
Fecha:
<script language="JavaScript">
// -- made by A1javascripts.com, please keep these credits when using this script
days = new Array(7)
days[1] = "Domingo";
days[2] = "Lunes";
days[3] = "Martes";
days[4] = "Miercoles";
days[5] = "Jueves";
days[6] = "Viernes";
days[7] = "Sabado";
months = new Array(12)
months[1] = "Enero";
months[2] = "Febrero";
months[3] = "Marzo";
months[4] = "Abril";
months[5] = "Mayo";
months[6] = "Junio";
months[7] = "Julio";
months[8] = "Agosto";
months[9] = "Septiembre";
months[10] = "Octubre";
months[11] = "Noviembre";
months[12] = "Diciembre";
today = new Date(); day = days[today.getDay() + 1]
month = months[today.getMonth() + 1]
date = today.getDate()
year=today.getYear();
if (year < 2000)
year = year + 1900;
document.write ("<font face=Verdana size=2>" + day + ", " + month + " " + date + ", " + year + "</font>")
// -- end hiding
</script>
</b>
Abre una ventana en forma de ventana:
<body>
<SCRIPT LANGUAGE="JavaScript">
function janelanimada(endereco) {
var velocidadev = 20;
var topo = 0;
var esquerda = 0;
var velocidadeh = 20;
if (document.all) {
var tamlar = window.screen.availHeight - topo;
var tamjan = window.screen.availWidth - esquerda;
var tamanho = window.open("","","left=" + esquerda + ",top=" + topo + ",width=1,height=1,scrollbars=yes,menubar=yes,status=yes");
for (sizeheight = 1; sizeheight < tamlar; sizeheight += velocidadev) {
tamanho.resizeTo("1",sizeheight );}
for (sizewidth = 1; sizewidth < tamjan; sizewidth += velocidadeh) {
tamanho.resizeTo(sizewidth+6,sizeheight );}
tamanho.location = endereco;}
else
window.location = endereco;}
</script>
<a href="index.htm" onClick="janelanimada('index.htm');return false;">Principal</a><br>
Imagen sigue ratón :
<HEAD>
<script language="JavaScript">
<!--
function YY_Mousetrace(evnt)
{
if (yyns4)
{
if (evnt.pageX) {yy_ml=evnt.pageX; yy_mt=evnt.pageY;} }
else{
yy_ml=(event.clientX + document.body.scrollLeft);
yy_mt=(event.clientY + document.body.scrollTop);
}
if (yy_tracescript)eval(yy_tracescript)
}
//-->
</script>
<script language="JavaScript">
<!--
function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) {
if ((document.layers)||(document.all)){
eval("myfunc=yyfnx.replace(/x/gi, yycnt)");
with (Math) {yynextx= eval(myfunc)}
eval("myfunc=yyfny.replace(/x/gi, yycnt)");
with (Math) {yynexty= eval(myfunc)}
yycnt=(yyloop && yycnt>=yystep*yybilder)?0:yycnt+yystep;
if (document.layers){
eval(yydiv+".top="+(yynexty+yytop))
eval(yydiv+".left="+(yynextx+yyleft))
}
if (document.all){
eval("yydiv=yydiv.replace(/.layers/gi, '.all')");
eval(yydiv+".style.pixelTop="+(yynexty+yytop));
eval(yydiv+".style.pixelLeft="+(yynextx+yyleft));
}
argStr='YY_Layerfx('+yyleft+','+yytop+',"'+yyfnx+'","'+yyfny+'","'+yydiv+'", '+yybilder+','+yyloop+','+yyto+','+yycnt+','+yystep+')';
if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");}
}
}
//-->
</script>
<script language='JavaScript'>
<!--
var yyns4=window.Event?true:false; var yy_mt = 0; var yy_ml = 0;
if (yyns4) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = YY_Mousetrace;
yy_tracescript = '';
//-->
</script>
<BODY>
<div id="Orbita" style="position:absolute; left: 475px; top: 11px; width: 36px; height: 32px"><img src="LAIMAGENQUEKIERES.gif" border=0></div>
<body>
<body onLoad="YY_Mousetrace('',',document.YY_Mousetrace1'); YY_Layerfx(10,10,'yy_ml','yy_mt','document.layers['Orbita']',50000,false,0,0,10)">
Imagen se pasea por la toda la ventana :
<td width="100%"><script language="JavaScript1.2">
var imagem="LAIMAGENKEKIERAS.gif"
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>
<p> </td>
Textos en la barra de estado como si fueran máquina de escribir :
<!-- Copiar el código dentro del tag HEAD -->
<script language="JavaScript">
var speed = 100
var pause = 3000
var timerID = null
var bannerRunning = false
var ar = new Array()
ar[0] = ">>>> Espero me agregues a tus favoritos <<<<"
ar[1] = " .... Mándame un mail con tus dudas ....."
ar[2] = "..... Datos sobre tu página y muchas otras cosas, ....."
ar[3] = "..... No olvides de visitar
http://farfako.fus.nu/ ....."
ar[4] = "..... Y envía tus escritos o dile a tus amigos, ....."
ar[5] = "..... ke tan chida esta mi web ....."
ar[6] = "..... Y si tienes un link bueno mándamelo ....."
var currentMessage = 0
var offset = 0
function stopBanner() {
if (bannerRunning)
clearTimeout(timerID)
bannerRunning = false
}
function startBanner() {
stopBanner()
showBanner()
}
function showBanner() {
var text = ar[currentMessage]
if (offset < text.length) {
if (text.charAt(offset) == " ")
offset++
var partialMessage = text.substring(0, offset + 1)
window.status = partialMessage
offset++ // IE sometimes has trouble with "++offset"
timerID = setTimeout("showBanner()", speed)
bannerRunning = true
} else {
offset = 0
currentMessage++
if (currentMessage == ar.length)
currentMessage = 0
timerID = setTimeout("showBanner()", pause)
bannerRunning = true
}
}
startBanner();
// -->
</script>
Menú desplegable:
// This script came from Web-Development.Com JavaScript Site
// Located at
http://www.web-development.com/
function goTo(form) {
var myindex=form.dest.selectedIndex
window.open(form.dest.options[myindex].value);
}
// --End Hiding Here -->
</script>
</head>
<body bgcolor="ffffff">
<CENTER>
<FORM NAME="myForm">
<SELECT NAME="dest" SIZE=1>
<OPTION SELECTED VALUE="">Pull Down Menu
<OPTION VALUE="http://www.web-development.com/">Web-Development.Com
<OPTION VALUE="http://www.web-development.com/kaigler/">Kaigler's Home Page
<OPTION VALUE="http://www.web-development.com/kaigler/cfa/">Kaigler's College Football Picks
<OPTION VALUE="http://www.web-development.com/site.htm">Site of the Week
</SELECT>
<P>
<INPUT TYPE="BUTTON" VALUE="Go" onClick="goTo(this.form)">
</FORM>
</CENTER>
</body>
El cursor parece una mira :
<style>
<!--
#leftright, #topdown{
position:absolute;
left:0;
top:0;
width:1px;
height:1px;
layer-background-color:black;
background-color:black;
z-index:100;
font-size:1px;
}
-->
</style>
<div id="leftright" style="width:expression(document.body.clientWidth-2)"></div>
<div id="topdown" style="height:expression(document.body.clientHeight-2)"></div>
<script language="JavaScript1.2">
<!--
/*
Document crosshair Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more free DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
if (document.all&&!window.print){
leftright.style.width=document.body.clientWidth-2
topdown.style.height=document.body.clientHeight-2
}
else if (document.layers){
document.leftright.clip.width=window.innerWidth
document.leftright.clip.height=1
document.topdown.clip.width=1
document.topdown.clip.height=window.innerHeight
}
function followmouse1(){
//move cross engine for IE 4+
leftright.style.pixelTop=document.body.scrollTop+event.clientY+1
topdown.style.pixelTop=document.body.scrollTop
if (event.clientX<document.body.clientWidth-2)
topdown.style.pixelLeft=document.body.scrollLeft+event.clientX+1
else
topdown.style.pixelLeft=document.body.clientWidth-2
}
function followmouse2(e){
//move cross engine for NS 4+
document.leftright.top=e.y+1
document.topdown.top=pageYOffset
document.topdown.left=e.x+1
}
if (document.all)
document.onmousemove=followmouse1
else if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=followmouse2
}
function regenerate(){
window.location.reload()
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400)
}
if ((document.all&&!window.print)||document.layers)
//if the user is using IE 4 or NS 4, both NOT IE 5+
window.onload=regenerate2
//-->
</script>
Nevando en la pagina :
<head>
<script language="javascript">
// Nevando en la pagina por Eloi Gallés Villaplana
//
// Este script y otros muchos pueden
// descarse on-line de forma gratuita
// en El Código:
www.elcodigo.net
//configuracion
var numero = 8 ; //numero de copos
var velocidad = 4 ; //velocidad a la que caen
var imagennieve = "/images/bg_WhitePaper.gif"; //imagen para el copito de nieve
//deteccion navegadores
var ns4arriba = (document.layers) ? 1 : 0;
var ie4arriba = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_ancho = 1024, doc_alto = 768;
function nieva() {
if (ns4arriba) {
doc_ancho = self.innerWidth;
doc_alto = self.innerHeight;
} else if (ie4arriba) {
doc_ancho = document.body.clientWidth;
doc_alto = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < numero; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_ancho-50);
yp[i] = Math.random()*doc_alto;
am[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
if (ns4arriba) {
if (i == 0) {
document.write("<layer name="dot"+ i +"" left="15" ");
document.write("top="15" visibility="show"><img src="");
document.write(imagennieve + "" border="0"></layer>");
} else {
document.write("<layer name="dot"+ i +"" left="15" ");
document.write("top="15" visibility="show"><img src="");
document.write(imagennieve + "" border="0"></layer>");
}
} else if (ie4arriba) {
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(imagennieve + "" 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(imagennieve + "" border="0"></div>");
}
}
}
if (ns4arriba) {
nieve_netscape();
} else if (ie4arriba) {
nieve_explorer();
}
}
function nieve_netscape() {
for (i = 0; i < numero; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_alto) {
xp[i] = Math.random()*(doc_ancho-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_ancho = self.innerWidth;
doc_alto = 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("nieve_netscape()", velocidad);
}
function nieve_explorer() {
for (i = 0; i < numero; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_alto-10) {
xp[i] = Math.random()*(doc_ancho-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_ancho = document.body.clientWidth;
doc_alto = 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("nieve_explorer()", velocidad);
}
</script>
</head>
<body>
<!-- Para que comience a nevar -->
<script language="javascript">nieva()</script>
</body>
Reloj de Javasprit :
<head>
<script language="JavaScript">
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
window.event.cancelBubble = true
window.event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
</script>
</head>
Creo que el más popular (Haz que tu página tiemble) :
<script language="JavaScript1.2">
function tremer(n) {
if (self.moveBy) {
for (i = 10; 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);
}}}}
tremer(5)
</script>
______________