스크롤 됬을 떄 fade in 효과
http://jsfiddle.net/tcloninger/e5qad/
$(document).ready(function() { /* Every time the window is scrolled ... */ $(window).scroll( function(){ /* Check the location of each desired element */ $('.hideme').each( function(i){ var bottom_of_object = $(this).offset().top + $(this).outerHeight(); var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1'},500); } }); }); });
'Front-end > Javascript JQuery' 카테고리의 다른 글
파일 이름으로 쓸 수 있는지 자바스크립트 정규식 test (0) | 2015.09.28 |
---|---|
[JQuery] 정규식 선택자 (0) | 2015.01.10 |
[Javascript] adjust iframe height iframe 높이 콘텐츠에 맞추기 (0) | 2015.01.03 |