Ver Mensaje Individual
  #5 (permalink)  
Antiguo 22/11/2012, 15:33
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años, 3 meses
Puntos: 834
Respuesta: duda sobre eventos

Fijate si te sirve este ejemplo:
Código PHP:
<!DOCTYPE html>
<
html>
<
head>
<
meta charset="utf-8" />
<
title></title>
<
script type="text/javascript">
var 
p=1;
onload=function(){
    
document.onscroll=function(){
        if((
document.getElementById('contenedor').offsetHeight-document.documentElement.clientHeight - (document.documentElement.scrollTop+document.body.scrollTop || self.pageYOffset))<1000){
            
document.getElementById('pag').innerHTML='Página '+(++p);//acá traer más contenido via AJAX
            
document.getElementById('contenedor').style.height=(parseInt(document.getElementById('contenedor').style.height,10)+1000)+'px';
        }
    }
}
</script>

</head>
<body>
<div id="contenedor" style="height:1000px; position:relative">
<div style="position:fixed; top:0; left:0; width:100%; height:20px" id="pag">Página 1</div>
</div>
</body>
</html>