-clientX, clientY는 window 창에서 시작다.
-pageX, pageY는 page의 제일 상위부터 시작한다. (페이지의 시작점부터)
MouseEvent.clientX - Web APIs | MDN
The clientX read-only property of the MouseEvent interface provides the horizontal coordinate within the application's viewport at which the event occurred (as opposed to the coordinate within the page). For example, clicking on the left edge of the viewpo
developer.mozilla.org
MouseEvent로 커서 위치를 파악할 수 있다.
728x90
'IT > JavaScript' 카테고리의 다른 글
[JavaScript] (해결) 동적으로 font awesome 아이콘 추가하기 (2) | 2021.01.04 |
---|---|
[JavaScript] 렌더링 트리(Critical Rendering Tree) (0) | 2021.01.03 |
[JavaScript] document.querySelector (1) | 2021.01.01 |
[JavaScript] 객체 기본 (0) | 2020.12.31 |
[JavaScript] Switch language button (0) | 2020.12.31 |