Ver Mensaje Individual
  #8 (permalink)  
Antiguo 21/09/2010, 08:26
Avatar de maxi_lance
maxi_lance
 
Fecha de Ingreso: julio-2006
Ubicación: Capital Federal
Mensajes: 220
Antigüedad: 17 años, 9 meses
Puntos: 2
Respuesta: Mostrar <li> por orden en lugar de random

Gracias Dany por el ejemplo ...
Al final modifiqué un poco el script de DAvid y funcionó ...

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. this.randomtip = function(){
  3.  
  4.     function nextTip() {
  5.     var child = Number($("#tips").data("current"));
  6.    
  7.     if (child > 7) { var child = 1}
  8.     $("#tips li").hide();  
  9.     $("#tips li:nth-child(" + child + ")").fadeIn();
  10.    
  11.     child++;
  12.     $("#tips").data("current", child);
  13.     }
  14.  
  15. $(document).ready(function(){
  16.     var pause = 5250;
  17.    
  18.     $("#tips").data("current", 1);
  19.     nextTip();
  20.    
  21.     setInterval(nextTip, pause);
  22. });
  23.  
  24.    
  25. };
  26.  
  27. $(document).ready(function(){  
  28.     randomtip();
  29. });
  30. </script>

Le agregué esta linea:
Código HTML:
if (child > 7) { var child = 1}
Para que al llegar al ultimo <li> vuelva a mostrar el primero, siempre en Loop, que no termine nunca.

Saludos!