Your Search Results

    Touch Redirect 1

    « DOM Reference

    A Touch object represents a single point of contact between the user and a touch-sensitive interface device (which may be, for example, a touchscreen or a trackpad).

    Attributes

    The following attributes describe the user's touch.

    Note: Many of these values are hardware-dependent; for example, if the device doesn't have a way to detect the amount of pressure placed on the surface, the force value will always be 1.0. This may also be the case for radiusX and radiusY; if the hardware reports only a single point, these values will be 1.
    Touch.identifier
    A unique identifier for this Touch object. A given touch (say, by a finger) will have the same identifier for the duration of its movement around the surface. This lets you ensure that you're tracking the same touch all the time. Read only.
    Touch.screenX
    The X coordinate of the touch point relative to the left edge of the screen. Read only.
    Touch.screenY
    The Y coordinate of the touch point relative to the top edge of the screen. Read only.
    Touch.clientX
    The X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset. Read only.
    Touch.clientY
    The Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset. Read only.
    Touch.pageX
    The X coordinate of the touch point relative to the left edge of the document. Unlike clientX, this value includes the horizontal scroll offset, if any. Read only.
    Touch.pageY
    The Y coordinate of the touch point relative to the top of the document. Unlike clientY, this value includes the vertical scroll offset, if any. Read only.
    Touch.radiusX
    The X radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenX. Read only.
    Touch.radiusY
    The Y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenY. Read only.
    Touch.rotationAngle
    The angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface. Read only.
    Touch.force
    The amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure). Read only.
    Touch.target
    The Element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document. Note that if the target is removed from the document, events will still be targeted at it, and hence won't necessarily bubble up to the window or document anymore. If there's any risk of an element being removed while it is being touched, best practice is to attach the touch listeners directly to the target. Read only.

    The touch area

    The Touch.radiusX, Touch.radiusY, and Touch.rotationAngle describe the area of contact between the user and the screen. This can be helpful when dealing with imprecise pointing devices such as fingers. These values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip).

    Example

    See the example on the main Touch events article.

    See also

    Specification

    Touch Events Specification

    Document Tags and Contributors

    Contributors to this page: Sheppy
    Last updated by: Sheppy,