content
content copied to clipboard
MouseEvent.clientX and MouseEvent.clientY is the coordinates of the window, but the documentation is written relative to the local dom
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
What specific section or headline is this issue about?
MouseEvent.clientX and MouseEvent.clientY
What information was incorrect, unhelpful, or incomplete?
MouseEvent.clientX and MouseEvent.clientY is the coordinates of the window, but the documentation is written relative to the local dom。
the page correct: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX
What did you expect to see?
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 viewport will always result in a mouse event with a clientX value of 0, regardless of whether the page is scrolled horizontally.
Do you have any supporting links, references, or citations?
- https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientX
- https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/clientY
- w3c: https://www.w3.org/TR/2022/WD-uievents-20220913/#dom-mouseeventinit-clientx
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/api/mouseevent - MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/api/mouseevent/index.md
- Last commit: https://github.com/mdn/content/commit/a6390b5024f29bcd6bdab5eedade24e3b446b37b
- Document last modified: 2022-10-21T06:49:22.000Z