Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. MouseEvent
  4. screenY

MouseEvent: screenY property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

ThescreenY read-only property of theMouseEvent interface provides the vertical coordinate (offset) of the mouse pointer inscreen coordinates.

Value

Adouble floating point value in pixels.

Early versions of the spec defined this as an integer referring to the number of pixels.

Examples

This example displays your mouse's coordinates whenever you trigger themousemove event.

HTML

html
<p>Move your mouse to see its position.</p><p></p>

JavaScript

js
let screenLog = document.querySelector("#screen-log");document.addEventListener("mousemove", logKey);function logKey(e) {  screenLog.innerText = `    Screen X/Y: ${e.screenX}, ${e.screenY}    Client X/Y: ${e.clientX}, ${e.clientY}`;}

Result

Specifications

Specification
UI Events
# dom-mouseevent-screeny

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp