Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/07/2014, 14:55
Avatar de memoadian
memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 15 años, 7 meses
Puntos: 641
Respuesta: Footer fijo y desplegable

¿Y como sabes cuando el body llega al final?

pues con el scroll

Código Javascript:
Ver original
  1. $(window).scroll(function(evnt){
  2.                                    
  3.             var offset = $(window).scrollTop();
  4.            
  5.             if(footerCatch == 0){
  6.                 footerCatch = $('body').height() - $(window).height();
  7.             }
  8.  
  9.             if(offset >= navCatch){
  10.                 $('#header').not(".fixed-navigation.header-shadow").addClass('fixed-navigation header-shadow');
  11.             }else{
  12.                 $('#header.fixed-navigation.header-shadow').removeClass('fixed-navigation header-shadow');
  13.             }
  14.  
  15.             if($(window).height() < $('body').height() && !shortPage){
  16.  
  17.                 if(offset >= (footerCatch - 1) && !footerActive){
  18.                     !footerCaught && catchFooter();
  19.                 } else {
  20.                     footerCaught && releaseFooter();
  21.                 }
  22.             }
  23.  
  24.             // Parallax Scrolling for Hero Image
  25.             requestAnimationFrame(function(){
  26.                 slideItem();
  27.             });
  28.  
  29.         });

esta es la función que usan.