Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/05/2014, 13:06
dharmauser
 
Fecha de Ingreso: mayo-2014
Mensajes: 15
Antigüedad: 10 años
Puntos: 0
Respuesta: ¿Como usar este script para rotar textos mas de una vez por pagina?

Hola Italico76. Gracias por tu respuesta.

El asunto es que en este caso hay diferentes textos rotando en el mismo párrafo. En mi caso es diferente lo que requiero.

Tengo unas 12 areas diferentes, y en cada una de ellas requiero que se roten dos textos.
¿ Si me explico ?

Seria algo como esto pero al correrlo no me funciona.

Código Java:
Ver original
  1. var rotatingTextElement;
  2.         var rotatingText = new Array();
  3.         var ctr = 0;
  4.  
  5.         function initRotateText() {
  6.         rotatingTextElement = document.getElementById("textToChange");
  7.         rotatingText[0] = rotatingTextElement.innerHTML;
  8.         rotatingText[1] = "no";
  9.         setInterval(rotateText, 3000);
  10.         }
  11.         function rotateText() {
  12.         ctr++;
  13.         if(ctr >= rotatingText.length) {
  14.         ctr = 0;
  15.         }
  16.         rotatingTextElement.innerHTML = rotatingText[ctr];
  17.         }
  18.         window.onload = initRotateText;
  19.  
  20.  
  21. var rotatingTextElement;
  22.         var rotatingText = new Array();
  23.         var ctr = 0;
  24.  
  25.         function initRotateText() {
  26.         rotatingTextElement = document.getElementById("textToChange2");
  27.         rotatingText[0] = rotatingTextElement.innerHTML;
  28.         rotatingText[1] = "no";
  29.         setInterval(rotateText, 3000);
  30.         }
  31.         function rotateText() {
  32.         ctr++;
  33.         if(ctr >= rotatingText.length) {
  34.         ctr = 0;
  35.         }
  36.         rotatingTextElement.innerHTML = rotatingText[ctr];
  37.         }
  38.         window.onload = initRotateText;
  39.  
  40. var rotatingTextElement;
  41.         var rotatingText = new Array();
  42.         var ctr = 0;
  43.  
  44.         function initRotateText() {
  45.         rotatingTextElement = document.getElementById("textToChange3");
  46.         rotatingText[0] = rotatingTextElement.innerHTML;
  47.         rotatingText[1] = "no";
  48.         setInterval(rotateText, 3000);
  49.         }
  50.         function rotateText() {
  51.         ctr++;
  52.         if(ctr >= rotatingText.length) {
  53.         ctr = 0;
  54.         }
  55.         rotatingTextElement.innerHTML = rotatingText[ctr];
  56.         }
  57.         window.onload = initRotateText;