width

Jump to: navigation, search

width

This page has been flagged with the following issues:

High-level issues:


W3C Working Draft

Summary

The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.

Property of dom/PointerEvent

Syntax

Note: This property is read-only.

var result = event.width;

Examples

Resizing an element to match the contact geometry

JavaScript

<script> window.addEventListener("pointerdown", checkPointerSize, false); function checkPointerSize(event) { event.target.style.width = event.width + "px"; event.target.style.height = event.height + "px"; } </script>


Usage

This value may be updated on each event for a given pointer. For devices which have a contact geometry but the actual geometry is not reported by the hardware, a default value may be provided by the user agent to approximate the geometry typical of that pointer type. Otherwise, the value must be 0.



Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support ?
?
Supported (when?)
?
?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?


Compatibility notes

Browser Version Note
Internet Explorer 10 Pointer events are supported with the MS prefix. In the example above, IE10 would require 'MSPointerDown rather than pointerdown.