Web/jquery
[제이쿼리] 스크롤, 위치 값 구하기
아랄라랄라
2018. 5. 15. 14:56
스크롤 위치 구하기
.scrollLeft();
.scrollTop();
스크롤 위치 설정하기
.scrollLeft(위치값);
.scrollTop(위치값);
문서 크기 구하기
$(document).width();
$(document).height();
전체화면 크기 구하기
screen.width;
screen.height;
유효한 전체 화면 크기 구하기
screen.availWidth;
screen.availHeight;
윈도우 기본 크기 구하기
window.innerWidth;
window.innerHeight;
윈도우 기본 크기 + 메뉴바 + 툴바 영역이 포함된 크기 구하기
$(window).Width();
$(window).Height();
윈도우 기본 크기 + 메뉴바 + 툴바 + 스크롤바 영역이 포함된 크기 구하기
window.outerWidth;
window.outerHeight;
https://jsfiddle.net/Kimara/jbj508Lg/3/
윈도우 위치 다루기
window.screenLeft;
window.screenTop;
위치 값 설정하기
window.moveTo(dx,dy);
window.moveBy(dx,dy);
윈도우 스크롤 위치 값 구하기
window.pageXOffset;
window.pageYOffset;
윈도우 스크롤 위치 설정하기
window.scrollTo(x,y);
window.scrollBy(x,y);
윈도우 스크롤 이벤트 처리하기
$(window).on('scroll', function(){});
728x90