[JavaScript][MEDIO] Texto cambiante en la barra de titulo.

Iniciado por ANTRAX, Febrero 24, 2010, 11:17:13 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Febrero 24, 2010, 11:17:13 AM Ultima modificación: Abril 18, 2014, 11:27:10 AM por Expermicid
Holas.. parecido al anterior..

Este código te permite colocar varios mensaje en la barra de titulo, que es esa franja que queda en el extremo superior del navegador donde también se encuentran los botones de cerrar, restaurar y minimizar.

Código: javascript
<html>

<head>
<title>Texto animado cambiante en la barra de titulo</title>
<SCRIPT LANGUAGE="JavaScript">

var message = new Array();

message[0] = "comentario";
message[1] = "aburrido";
message[2] = "o quizas";
message[3] = "interesante";
message[4] = "¿quien sabe?";
message[5] = "solo se que no se nada";
message[6] = "... JA JA JA JA ";

// Set the number of repetitions (how many times the arrow
// cycle repeats with each message).
var reps = 2;
var speed = 200;  // Set the overall speed (larger number = slower action).

var p = message.length;
var T = "";
var C = 0;
var mC = 0;
var s = 0;
var sT = null;
if (reps < 1) reps = 1;
function doTheThing() {
T = message[mC];
A();
}
function A() {
s++;
if (s > 8) { s = 1;}
// you can fiddle with the patterns here...
if (s == 1) { document.title = '||||||====||| '+T+' -----'; }
if (s == 2) { document.title = '|||=|||===||| '+T+' -----'; }
if (s == 3) { document.title = '|||==|||==||| '+T+' -----'; }
if (s == 4) { document.title = '|||===|||=||| '+T+' -----'; }
if (s == 5) { document.title = '|||====|||||| '+T+' -----'; }
if (s == 6) { document.title = '|||===|||=||| '+T+' -----'; }
if (s == 7) { document.title = '|||==|||==||| '+T+' -----'; }
if (s == 8) { document.title = '|||=|||===||| '+T+' -----'; }
if (C < (8 * reps)) {
sT = setTimeout("A()", speed);
C++;
}
else {
C = 0;
s = 0;
mC++;
if(mC > p - 1) mC = 0;
sT = null;
doTheThing();
   }
}
doTheThing();
</script>
</head>

<body  

</body>

</html>