centrer en javascript

centrer en javascript - HTML/CSS - Programmation

Marsh Posté le 26-06-2006 à 11:26:37    

comment faire pour center ce texte animé??
 
k2000text  = "De MOUVAUX";
k2000pos = 0;
k2000increment = 1;
 
function k2000effet()  
   {
   k2000aff = "";
   for(k2000a=0;k2000a<k2000text.length;k2000a++)
      {
      k2000lettre = k2000text.charAt(k2000a);
      if(k2000a == k2000pos || k2000a == (k2000pos+k2000increment))
         k2000aff += "<FONT COLOR=red>"+k2000lettre+"</FONT>";
      else
         k2000aff += k2000lettre;
      }
   document.getElementById("k2000" ).innerHTML = k2000aff;
   if(k2000pos == k2000text.length)
      k2000increment = -1;
   if(k2000pos == 0 && k2000increment== -1)
      k2000increment = 1;
   k2000pos = k2000pos+k2000increment;
   timer = setTimeout("k2000effet()",60)
   }
</SCRIPT>
<!-- FIN DU SCRIPT -->

Reply

Marsh Posté le 26-06-2006 à 11:26:37   

Reply

Marsh Posté le 26-06-2006 à 14:01:27    

C simple :  
 
 :bounce:  
 
les balise <center></center> ou <p align="center"></p> ou <div style="text-align:center"></div>
 
 

Code :
  1. /* tu mes <center> é pi C bon */
  2. <center>
  3. k2000text  = "De MOUVAUX";
  4. k2000pos = 0;
  5. k2000increment = 1;
  6. function k2000effet() 
  7.    {
  8.    k2000aff = "";
  9.    for(k2000a=0;k2000a<k2000text.length;k2000a++)
  10.       {
  11.       k2000lettre = k2000text.charAt(k2000a);
  12.       if(k2000a == k2000pos || k2000a == (k2000pos+k2000increment))
  13.          k2000aff += "<FONT COLOR=red>"+k2000lettre+"</FONT>";
  14.       else
  15.          k2000aff += k2000lettre;
  16.       }
  17.    document.getElementById("k2000" ).innerHTML = k2000aff;
  18.    if(k2000pos == k2000text.length)
  19.       k2000increment = -1;
  20.    if(k2000pos == 0 && k2000increment== -1)
  21.       k2000increment = 1;
  22.    k2000pos = k2000pos+k2000increment;
  23.    timer = setTimeout("k2000effet()",60)
  24.    }
  25. </SCRIPT>
  26. <!-- FIN DU SCRIPT -->
  27. </center>


 :sol:  
 
 
tu dois conaitre sa si tu a apris l'HTML

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed