JavaScript Response

Set the pointerDown property of the jqxResponse. Author: http://jqwidgets.com

by jqwidgets

HTML

<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id="pointerInfoDown"></div>
<div id="pointerInfoMove"></div>
<div id="pointerInfoUp"></div>

JavaScript

var response = new $.jqx.response();

var resizeFunction = function () {
    $("#response").html("resizeFunction is called");
}

response.resize([resizeFunction]);

var response = new $.jqx.response();
var device = response.device;

response.pointerDown($(document), function (event, position, pointerType) {
    // event is a "touchstart" or "mousedown" event object depending on whether the device is touch-enabled.
    $("#pointerInfoDown").html("Pointer Down: " + position.left + ", " + position.top + ", Type: " + pointerType);
});
response.pointerUp($(document), function (event, position, pointerType) {
    // event is a "touchend" or "mouseup" event object depending on whether the device is touch-enabled.
    $("#pointerInfoUp").html("Pointer Up: " + position.left + ", " + position.top + ", Type: " + pointerType);
});
response.pointerMove($(document), function (event, position, pointerType) {
    // event is a "mousemove" or "touchmove" event object depending on whether the device is touch-enabled.
    $("#pointerInfoMove").html("Pointer Move: " + position.left + ", " + position.top + ", Type: " + pointerType);
    if (device.touch) {
        // stops the default action of the event. 
        event.preventDefault();
        return false;
    }
});