1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="fr" />
<style type="text/css">
<!--
.couleurDefaut{
color : #000000;
font-size: 20pt;
}
.couleurAutre{
color : #FF0000;
font-size: 20pt;
}
-->
</style>
<script type="text/javascript">
<!--
var texte = "Transfert effectué" //texte à afficher
var compteur = 2; // nombre de clignotements (si -1 => en boucle)
var vitesse = "100"; // vitesse de clignotement en ms
// variables globales - ne pas modifier leurs valeurs
var inc = 0;
var pos = 0;
var chrono = null;
function k2000()
{
var c = document.getElementById("divMsg");
var tabSpan = c.getElementsByTagName("span");
var i;
if (pos==0)
{
tabSpan[tabSpan.length-2].className = "couleurDefaut";
tabSpan[tabSpan.length-1].className = "couleurDefaut";
tabSpan[pos].className = "couleurAutre";
pos++;
tabSpan[pos].className = "couleurAutre";
}
else
{
tabSpan[pos-1].className = "couleurDefaut";
pos++;
tabSpan[pos].className = "couleurAutre";
}
if (pos==tabSpan.length-1)
{
pos = 0;
inc++;
}
if (inc==compteur)
{
clearTimeout(chrono);
chrono = null;
tabSpan[tabSpan.length-2].className = "couleurDefaut";
tabSpan[tabSpan.length-1].className = "couleurDefaut";
}
}
function initK2000()
{
var c = document.getElementById("divMsg");
var i, elSpan;
for (i=0; i<texte.length; i++)
{
if (texte.charCodeAt(i)!=32) //32 code ASCII de l'espace
{
elSpan = document.createElement("span");
elSpan.appendChild(document.createTextNode(texte.charAt(i)));
elSpan.className = "couleurDefaut";
c.appendChild(elSpan);
}
else
{
c.appendChild(document.createTextNode(" "));
}
}
chrono = setInterval("k2000()", vitesse);
}
function arretK2000()
{
if (chrono!=null)
clearTimeout(chrono);
chrono = null;
}
//-->
</script>
</head>
<body onload="initK2000()" onunload="arretK2000()">
<div id="divMsg">
</div>
</body>
</html> |
Partager