Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. 鼠标事件
  4. MouseEvent.offsetX

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

MouseEvent.offsetX

Baseline Widely available

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

MouseEvent 接口的只读属性offsetX 规定了事件对象与目标节点的内填充边(padding edge)在 X 轴方向上的偏移量。

语法

var xOffset = instanceOfMouseEvent.offsetX;

返回值

一个双精度 浮点值。早期的规范将其规定为整数值。详见浏览器兼容性部分。

规范

Specification
CSSOM View Module
# dom-mouseevent-offsetx

浏览器兼容性

相关内容

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp