This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The offsetX
read-only property of the MouseEvent
interface provides the offset in the X coordinate of the mouse pointer between that event and the padding edge of the target node.
Syntax
var xOffset = instanceOfMouseEvent.offsetX;
Return value
A double
floating point value. Early versions of the spec defined this as an integer. See the Browser compatibility section for details.
Specifications
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'MouseEvent' in that specification. |
Working Draft | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
offsetX | Chrome Full support Yes | Edge Full support 12 | Firefox Full support 39 | IE Full support 9 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 43 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Value type changed from long to double | Chrome Full support 56 | Edge Full support ≤79 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 56 | Chrome Android Full support 56 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android Full support 6.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.