My site run a script which is only useful with the mouse, and which have to be disable on touch screen because it don't work with them.
So to solve it i use this :
var deviceAgent = navigator.userAgent.toLowerCase();
var isTouchDevice = Modernizr.touch ||
(deviceAgent.match(/(iphone|ipod|ipad)/) ||
deviceAgent.match(/(android)/) ||
deviceAgent.match(/(iemobile)/) ||
deviceAgent.match(/iphone/i) ||
deviceAgent.match(/ipad/i) ||
deviceAgent.match(/ipod/i) ||
deviceAgent.match(/blackberry/i) ||
deviceAgent.match(/bada/i));
if (!isTouchDevice) {
//my fonction
}
But this code doesn't detect other touch devices mainly like windows tablets (i have one), and i would like to detect with deviceAgent or anything else the other touch devices, or all touch devices if it's possible.
Thank you very much for your help !