09 Jun 2013

Is touchscreen on javascript

Category howto

Some of javascript shortcuts below here:

var is_touch_device = 'ontouchstart' in document.documentElement;
function isTouchDevice() {
    var el = document.createElement('div');
    el.setAttribute('ongesturestart', 'return;');
    return typeof el.ongesturestart === "function";
}

Comments