2013-09-03 14 views

답변

1

어쩌면이 분위기에서 당신을 얻을 감사합니다

이 꽤 많이 거래, 당신은 CSS로 할 수있는 나머지입니다,

var scrollTop,viewportHeight; 
$(window).scroll(function(e){ 
    scrollTop = $(window).scrollTop(); 
    viewportHeight = $(window).height(); 
    $('div:not(.visible)').each(function(){ 
     var top = $(this).offset().top; 
     var bottom = top + $(this).height(); 
     if(top <= scrollTop && bottom >= (scrollTop + viewportHeight)){ 
      $(this).addClass('visible'); 

     }else{ 
      console.log(scrollTop,top); 
     } 
    }); 
}); 

http://jsfiddle.net/ErBRf/8/