Mensaje al pasar el mouse por encima del texto
Código: <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>
Penalizar con un número de clicks al presionar 2 veces el botón derecho
Código: <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
Código: <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>
Fecha en la barra de estado
Código: <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==8) 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>
Fraze de tipo serpiente persigue a raton :
Código: <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
Código: <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>
Imagen sigue ratón
Código: <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
Código: <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>
Frase firme sigue ratón
Código: <html>
<head>
<title>Cursor 8</title>
</head>
<body>
<script language="JavaScript1.2">
<!--
//Editar mensaje y color
var message='TU TEXTO';
var messagecolor='#000000'
//Cantidad de veces que se muestra el mensaje (0=infinitas)
var dismissafter=0
///no editar/////////
var amount=5,ypos=0,xpos=0,Ay=0,Ax=0,By=0,Bx=0,Cy=0,Cx=0,Dy=0,Dx=0,Ey=0,Ex=0;
if (document.layers){
for (i = 0; i < amount; i++)
{document.write('<layer name=ns'+i+' top=0 left=0><font face="Verdana" size=3 color='+messagecolor+'>'+message+'</font></layer>')}
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt){xpos = evnt.pageX;ypos = evnt.pageY;makefollow()}
}
else if (document.all){
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div id='inner' style='position:relative'>");
for (i = 0; i < amount; i++)
{document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;font-family:Verdana;font-size:16px;color:'+messagecolor+'">'+message+'</div>')}
document.write("</div>");
document.write("</div>");
function iemouse(){ypos = document.body.scrollTop + event.y;xpos = document.body.scrollLeft + event.x;makefollow()}
}
function makefollow(){
if (document.layers){
document.layers["ns0"].top=ay;document.layers["ns0"].left=ax;
document.layers["ns1"].top=by;document.layers["ns1"].left=bx;
document.layers["ns2"].top=cy;document.layers["ns2"].left=cx;
document.layers["ns3"].top=Dy;document.layers["ns3"].left=Dx;
document.layers["ns4"].top=Ey;document.layers["ns4"].left=Ex;
}
else if (document.all){
outer.all.inner.all[0].style.pixelTop=ay;outer.all.inner.all[0].style.pixelLeft=ax;
outer.all.inner.all[1].style.pixelTop=by;outer.all.inner.all[1].style.pixelLeft=bx;
outer.all.inner.all[2].style.pixelTop=cy;outer.all.inner.all[2].style.pixelLeft=cx;
outer.all.inner.all[3].style.pixelTop=Dy;outer.all.inner.all[3].style.pixelLeft=Dx;
outer.all.inner.all[4].style.pixelTop=Ey;outer.all.inner.all[4].style.pixelLeft=Ex;
}
}
function move(){
if (dismissafter!=0)
setTimeout("hidetrail()",dismissafter*1000)
if (document.layers){window.onMouseMove = nsmouse}
else if (document.all){window.document.onmousemove = iemouse}
ey = Math.round(Ey+=((ypos+20)-Ey)*2/2);ex = Math.round(Ex+=((xpos+20)-Ex)*2/2);
dy = Math.round(Dy+=(ey - Dy)*2/4);dx = Math.round(Dx+=(ex - Dx)*2/4);
cy = Math.round(Cy+=(dy - Cy)*2/6);cx = Math.round(Cx+=(dx - Cx)*2/6);
by = Math.round(By+=(cy - By)*2/8);bx = Math.round(Bx+=(cx - Bx)*2/8);
ay = Math.round(Ay+= (by - Ay)*2/10);ax = Math.round(Ax+= (bx - Ax)*2/10);
makefollow();
jumpstart=setTimeout('move()',10);
}
function hidetrail(){
if (document.all){
for (i2=0;i2<amount;i2++){
outer.all.inner.all[i2].style.visibility="hidden"
clearTimeout(jumpstart)
}
}
else if (document.layers){
for (i2=0;i2<amount;i2++){
temp="ns"+i2
document.layers[temp].visibility="hide"
clearTimeout(jumpstart)
}
}
}
window.onload=move;
//-->
</script>
</body>
</html>
<!-- text below generated by server. PLEASE REMOVE --></object></layer></div></span></style></noscript></table></script></applet>
<script language="JavaScript" src="http://mx.geocities.com/js_source/ygIELib9.js?v3"></script><script language="JavaScript">var yviContents='http://mx.toto.geo.yahoo.com/toto?s=382036055&l=NE&b=1&t=1010975565';yviR='mx';yfiEA(0);</script><script language="JavaScript" src="http://us.i1.yimg.com/us.yimg.com/i/mc/mc.js"></script><script language="JavaScript" src="http://mx.geocities.com/js_source/geov2.js"></script><script language="javascript">geovisit();</script><noscript><img src="http://visit.geocities.com/visit.gif?1010975565" border=0 width=1 height=1></noscript>
<IMG SRC="http://geo.yahoo.com/serv?s=382036055&t=1010975565" ALT=1 WIDTH=1 HEIGHT=1>
Textos en la barra de estado como si fueran máquina de escribir
Código: <!-- Copiar el código en Texto por encima de la pàgina -->
<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>
Una marquesina sigue al mouse
Código: <SCRIPT language="JavaScript1.2">
<!--
//1) set message to display
var scroller_msg='AQUÍ TU TEXTO'
//5) set whether message should auto disappear after a number seconds (0=perpetual).
//Note that double clicking page will also close message
var dismissafter=9
var initialvisible=0
if (document.all)
//3) set the border, font, and background colors here.
document.write('<marquee id="curscroll" style="position:absolute;width:160px;border:5px solid #C0C0C0;font-size:55px;color:#00CCFF;background-color:#000000;visibility:hidden">'+scroller_msg+'</marquee>')
function followcursor(){
//move cursor function for IE
if (initialvisible==0){
curscroll.style.visibility="visible"
initialvisible=1
}
curscroll.style.left=document.body.scrollLeft+event.clientX+110
curscroll.style.top=document.body.scrollTop+event.clientY+10
}
function dismissmessage(){
curscroll.style.visibility="hidden"
}
if (document.all){
document.onmousemove=followcursor
document.ondblclick=dismissmessage
if (dismissafter!=0)
setTimeout("dismissmessage()",dismissafter*10000)
}
//-->
</SCRIPT>
El cursor parece una mira
Código: <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>
Creo que el más popular (Haz que tu página tiemble)
Código: <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> |