Texte clignatant

chris42210

Membre actif
20 Janvier 2009
148
2
44
Je voudrais faire clignoter un texte de maniere a attirer le visiteur, j'ai trouver grace à la fonction recherche le code html qui apparement est le suivant:


<html>
<head>
<title>Clignotement</title>
<script language="JavaScript">
i=0;
function couleur()
{
tabColoris = new Array ("#ffffff","#CE5852");// Vous pouvez changer les couleurs ou en rajouter
if (i+1 == tabColoris.length) i=0;
else i++;
document.getElementById("texte").setAttribute('color',tabColoris);
setTimeout("couleur()",500);
}
</script>
</head>
<body topmargin="0" leftmargin="0" onload="couleur()">
<p align="center"><font id="texte" size="8">Votre texte</font></b></p>
</form>
</body>
</html>


, simplement je ne comprend pas ou et comment on l'insère???
 
Bloc de code:
[COLOR=Red]
// document.html[/COLOR]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>-</title>
    <script type="text/javascript">
    <!--
    function twinkleColor(id, colors) {
        var i = 0;
        setInterval(function() {
            if (i == colors.length) { i = 0; }
            document.getElementById(id).style.color = colors[i++];
        }, 500);
    }
    
    function twinkleColorAndSizeWith(id, vector) {
        var i = vector.length - 1;
        setInterval(function() {
            if (i < 0) { i = vector.length - 1; }
            document.getElementById(id).style.color = vector[i].color;
            document.getElementById(id).style.fontSize = vector[i].fontsize;
            i--;
        }, 500);
    }
    -->
    </script>
</head>
<body>
    <p>
        <span id="twinkle1">Hello World 1!</span>
    </p>
    <p>
        <span id="twinkle2">Hello World 2!</span>
    </p>
    <script type="text/javascript">
    <!--
        twinkleColor("twinkle1", [
            "red", "orange", "yellow", "lime", "blue", "pink", "purple", "black"
        ]);

        twinkleColorAndSizeWith("twinkle2", [
            {"color" : "red", "fontsize" : "1.1em"},
            {"color" : "orange", "fontsize" : "1.2em"},
            {"color" : "yellow", "fontsize" : "1.3em"},
            {"color" : "lime", "fontsize" : "1.4em"},
            {"color" : "blue", "fontsize" : "1.3em"},
            {"color" : "pink", "fontsize" : "1.2em"},
            {"color" : "purple", "fontsize" : "1.1em"},
            {"color" : "black", "fontsize" : "1.0em"}
        ]);
    -->    
    </script>
</body>
</html>

copyright me, under license me, 2 minutes of my brain using my fingers

- I don't copy and paste random shit found using gogole (repeat)
- programming is fun (repeat)