사용자가 아래로 스크롤하면이를 감지하는 코드입니다.아래에서 아래로 스크롤을 감지하는 방법
$(window).scroll(function() {
var distance = $(window).scrollTop() -$(document).height() + $(window).height();
console.log(distance);
});
I는 웹 브라우저 (크롬)을 다시하는 경우와 윈도우가 아래로 스크롤 다운은 "거리"값이 0 또는 -1 크롬이다. 왜 이런 일이 발생하는지 모르겠습니다. 변환 $(document).height()
아래와 같이 정수 값 $(window).height()
값
http://stackoverflow.com/questions/9823645/detect-scroll-to-bottom-of-a-div?rq= 1 –