2
我一直在試圖檢測觸摸屏在Windows 8.1上專門IE 10/11按我的項目需求...如何在Internet Explorer 11上的Windows 8.1中檢測觸摸屏?
我試圖與Modernizer.touch但其對IE(觸摸屏),讓假的。
我一直在試圖檢測觸摸屏在Windows 8.1上專門IE 10/11按我的項目需求...如何在Internet Explorer 11上的Windows 8.1中檢測觸摸屏?
我試圖與Modernizer.touch但其對IE(觸摸屏),讓假的。
您可以使用navigator
?
function is_touch_device() {
return (('ontouchstart' in window)
|| (navigator.MaxTouchPoints > 0)
|| (navigator.msMaxTouchPoints > 0));
}
if (is_touch_device()) {
alert("Yay! Its touch");
}else{
alert("Not touch!")
}
完整的源:http://ctrlq.org/code/19616-detect-touch-screen-javascript