在桌面版本的Chrome 29上,“window.Touch”不再设置为“undefined” 这是一个问题,因为我用它来检测我的应用是否在触摸上运行设备。Chrome 29窗口。触摸
是否有替代解决方案?
感谢
在桌面版本的Chrome 29上,“window.Touch”不再设置为“undefined” 这是一个问题,因为我用它来检测我的应用是否在触摸上运行设备。Chrome 29窗口。触摸
是否有替代解决方案?
感谢
也许window.Touch.length
是一个解决这个问题?
是,使用'ontouchstart' in document.documentElement
[来源:How to check browser for touchstart support using JS/jQuery?]
var isTouchDevice = 'ontouchstart' in document.documentElement;
或
if('ontouchstart' in document.documentElement) {
//do something with touch stuff
}
很多更详细的答案,在这里更具体的解决方案:What's the best way to detect a 'touch screen' device using JavaScript?
的[什么是最好的可能的复制使用JavaScript检测'触摸屏'设备的方法?](http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detec叔一个触摸屏设备-使用JavaScript的) –