/

HTML / CSS / JavaScript Tutorial

JavaScript Properties and Methods for Touch objects

[this page | pdf | back links]

Some properties of TouchEvent objects within the JavaScript DOM involve Touch objects. These represent a single contact point on a touch-sensitive device. Touch objects support the following properties and methods:

 

Properties:

 

Property

Description

More

clientX

x-coordinate of touch point relative to left edge of browser viewport

 

clientY

y-coordinate of touch point relative to left edge of browser viewport

 

identifier

A unique identified assigned to a touch point, which it will retain for the duration of its movement around the surface

 

pageX

x-coordinate of touch point relative to left edge of page / document

 

pageY

y-coordinate of touch point relative to top edge of page / document

 

screenX

x-coordinate of touch point relative to left edge of screen

 

screenY

y-coordinate of touch point relative to top edge of screen

 

target

Element on which the touch point started when first placed on surface

 

 

There are also some (currently) experimental properties such as radiusX, radiusY, rotationAngle (relate to ellipse that most closely describes area of contact between user and surface) and force (amount of pressure being applied to surface by the user, between 0 and 1).

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile