Des liens hypertexte clignotants

Il peut être très attrayant pour un site d'avoir des liens hypertexte qui clignotent toutes les demi secondes en différentes couleurs.

Le code qui vous est ici proposé permet ceci. Pour avoir malgré tout un lien hypertexte qui ne clignote pas, il suffit de définir explicitement sa couleur

Ce lien hypertexte clignote - Celui-ci ne clignote pas.

<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
      function initArray()
        {
        for (var i=0 ; i<=initArray.arguments.length ; i++)
          {
          this[i] = initArray.arguments[i];
          }
        this.length = initArray.arguments.length;
        }
        
      var colors = new initArray("green","blue","black","purple","red","tan","red");
      delay = .5; //secondes
      link=0; vlink=2;

      function linkDance()
        {
        link = (link + 1)%colors.length
        vlink = (vlink + 1)%colors.length
        document.linkColor = colors[link];
        document.vlinkColor = colors[vlink];
        setTimeout("linkDance()",delay*1000);
        }
     
      linkDance();
    </SCRIPT>
  </HEAD>

  <BODY>
    <P>
    
<A HREF="http://www.trucmachin.com"> Ca clignote </a></P>
    <P>
     <A HREF="http://www.trucmachin.com"><FONT COLOR="#000000">ça ne clignote pas</FONT></A></P>
  </BODY>
</HTML>