문서 로딩시 스크롤값 얻기
$(document).scrollTop();
실시간(현재) 스크롤값 얻기 (현재 스크롤값이 로깅됨)
$(window).scroll(function () {
var scrollValue = $(document).scrollTop();
console.log(scrollValue);
});
- 출처: euntori.blog | [제이쿼리] 현재 스크롤값 가져오기(scroll) (2016.02.05)
References :
- 즐거움을 찾자 Find Fun!! | scroll(), 스크롤 이벤트 (2012.03.06)
- 원영's | jQeury 스크롤 내리다가 특정 영역(부분) 이벤트 발생시키기 (2017.04.27)
'jQuery' 카테고리의 다른 글
[jQuery] onBeforeUnload Event (0) | 2019.05.19 |
---|---|
[jQuery] 스크롤값에 따른 anchor offset 적용 (0) | 2019.05.01 |
[jQuery] $(document).ready() vs window.onload (0) | 2019.04.29 |
[jQuery] How to smooth scroll to an id after clicking a link from another page (0) | 2019.04.27 |
[jQuery] lang() Selector (0) | 2019.04.27 |