- Messages
- 1,811
- Reaction score
- 7
- Points
- 38
JavaScripts
Saludo al entrar a la pagina
Alerta al presionar el botón izquierdo
Animar Barra de titulo
Penalizar con 2 veces al boton izquierdo (absurdo y tipico)
Nevando en la pagina (tipico en navidad)
:naughty:
Saludo al entrar a la pagina
HTML:
<head>
<script language=JavaScript>
alert("Hola")
</script>
HTML:
<SCRIPT LANGUAGE=JavaScript>
<!--
function MsgBox(texto){
alert(texto);
return;
}
// -->
</SCRIPT>
<BODY OnClick="MsgBox('Eso no!!')">
HTML:
<script language="JavaScript1.2">
var message="AQUÍ TU TEXTO"
var message=message+" "
i="0"
var temptitle=""
var speed="15"
function titler(){
if (!document.all&&!document.getElementById)
return
document.title=temptitle+message.charAt(i)
temptitle=temptitle+message.charAt(i)
i++
if(i==message.length)
{
i="0"
temptitle=""
}
setTimeout("titler()",speed)
}
window.onload=titler
</script>
HTML:
<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>
HTML:
<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>