In an attempt to follow best practices, we\'re trying to use the proper JavaScript/jQuery events according to what device you are using. For example, we\'re building a mobil
Use this code to detect if the device supports touch.
Also work for windows 8 IE10 which uses 'MSPointerDown' event instead of 'touchmove'
var supportsTouch = false;
if ('ontouchstart' in window) {
//iOS & android
supportsTouch = true;
} else if(window.navigator.msPointerEnabled) {
// Windows
// To test for touch capable hardware
if(navigator.msMaxTouchPoints) {
supportsTouch = true;
}
}