Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/09/2009, 04:58
GENESISBM
 
Fecha de Ingreso: enero-2009
Mensajes: 119
Antigüedad: 15 años, 4 meses
Puntos: 1
Respuesta: Temporizador para pasar al otro DIV

Cita:
Iniciado por GatorV Ver Mensaje
Para agregar un temporizador necesitas usar window.setInterval para registrar la función a ejecutar.

Saludos.
Gracias Gator, mira, he hecho lo siguiente, pero sigue sin cargarme el div que quiero, te copio el codigo:

Código:
<!-- INCLUDE overall_header.html -->
<script type="text/javascript">
<!--
function temporizador ()
{
  window.setInterval("pagina()", 7000);
}
function pagina()
{
function preloader(){
        var xmlhttp=false;
        try{
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e){
                try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }catch(E){
                        xmlhttp = false;
                }
        }

        if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
                xmlhttp = new XMLHttpRequest();
        }
        return xmlhttp;
}
function publicidad(url){
        var contenido, preloader;
        contenido = document.getElementById('paginacapa');
        preloader = document.getElementById('distractor');
        //creamos el objeto XMLHttpRequest
        ajax=preloader(); 
        ajax.open("GET", url,true); 
        ajax.onreadystatechange=function(){
                if(ajax.readyState==1){
                }else if(ajax.readyState==4){
                        if(ajax.status==200){
                                contenido.innerHTML = ajax.responseText; 
                        }
                }
        }
        ajax.send(null);
}
}
//-->
</script>
<div id="distractor" align="center">
AQUI TENGO LA PAGINA QUE SE ME DEBERIA CARGAR PRIMERO, VA TODO PERFECTO
<body onload="temporizador()">
</div>
<div id="paginacapa" style="display:none">
PAGINA QUE DEBERIA MOSTRARSE A LOS 7 SEGUNDOS DE CARGAR LA ANTERIOR, NO CARGA
</div>
Pues este es el codigo que tengo ahora mismo, y yo diria que lo tengo todo bien, no? Pues se queda fijo el DIV "distractor", haber si me podeis ayudar :(