mobileViewer.TouchCompatibility

mobileViewer.TouchCompatibility(options) - Constructor

This class is used to simulate touch events in standard browsers using mouse interaction. It is currently used automatically by the mobileViewer.Control base class in order to provide basic touch support for desktop browsers that are used to visit a Mobile Viewer site. But it could be used for other purposes within a custom web application that requires some desktop browser support.

Methods

The contructor takes an options object, and supports the following properties:

touchStartHandler

An event handler to be invoked when the user starts a mouse-based 'touch' event

touchMoveHandler

An event handler to be invoked when the user moves the mouse with the button depressed

touchEndHandler

An event handler to be invoked when the user releases the mouse button, ending the 'touch' event

The original events from the mousedown, mousemove, and mouseup actions are repackaged into objects that resemble the touch events created by the mobile Apple Safari browser. This will not produce exactly the same object structure, but has proved to be sufficient in the controls created so far.