Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/09/2012, 22:54
Hallking
 
Fecha de Ingreso: febrero-2009
Mensajes: 188
Antigüedad: 15 años, 3 meses
Puntos: 1
Recargar div cada x tiempo

Buenas a todos..
El motivo de este pos el que me gustaría hacer un que div se recargue casa x tiempo.. el div llama una función javascrip que contiene un array random...

este es mi codigo

Código:
<html>
	<head>
		<title>Prueba</title>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

		<script language="javascript">
var NoRepite = new Array();
            function texto_aleatorio(){
				var img = "herald.png";
				var nomb = "Herald Difo";
                var textos = new Array()
                textos[0] = img,nomb;
                textos[1] = "jennifer.png";
                textos[2] = "jenny.png";
                textos[3] = "joel.png";
                textos[4] = "jose.png";
				textos[5] = "yasiris.png";
                
                var OK = true;
                
                while(OK){
                    var aleat = Math.random() * (textos.length);
                    aleat = Math.floor(aleat);
                    if(NoRepite.indexOf(aleat)==-1){
                        NoRepite.push(aleat);
                        OK = false;
                    }
                }
                document.write(textos[aleat]);
            }
		</script>
	</head>
<body>
<div id="content">
				<div class="grid_5 alpha">
					<div class="grid_5 alpha" id="fondos">
						<div id="imagen content" class="float">
							<script language=javascript>texto_aleatorio()</script>
						</div>		
					</div>
					
					<div class="grid_5 alpha" id="fondos">
						<div id="imagen" class="float">
							<script language=javascript>texto_aleatorio()</script>
						</div>	
					</div>					
					
					<div class="grid_5 alpha" id="fondos">
						<div id="imagen" class="float">
							<script language=javascript>texto_aleatorio()</script>
						</div>	
					</div>
				</div>
</div>
</body>
</html>