如何检测屏幕是否触摸敏感?

时间:2020-12-10 00:18:26

I am developing an application for Windows 8 (Metro UI). I am using HTML5, JavaScript, jQuery etc for development. I want to show a different user interface if the screen does not support screen touch events.

我正在开发Windows 8(Metro UI)的应用程序。我正在使用HTML5,JavaScript,jQuery等进行开发。如果屏幕不支持屏幕触摸事件,我想显示不同的用户界面。

How can I detect if screen support touch sensitive in Windows 8 using JavaScript?

如何使用JavaScript检测Windows 8中的屏幕是否支持触敏?

1 个解决方案

#1


8  

See here: Detecting Touch Hardware in IE 10

请参阅此处:在IE 10中检测触摸硬件

From the above page:

从上面的页面:

In order to test for touch in Internet Explorer 10, which will ship with the first batch of Windows 8 tablets later this year, you can call the window.navigator.msMaxTouchPoints method

为了测试Internet Explorer 10中的触摸,它将在今年晚些时候发布第一批Windows 8平板电脑,您可以调用window.navigator.msMaxTouchPoints方法

if (window.navigator.msMaxTouchPoints) {
// touch device
}
else {
// non-touch device
}

#1


8  

See here: Detecting Touch Hardware in IE 10

请参阅此处:在IE 10中检测触摸硬件

From the above page:

从上面的页面:

In order to test for touch in Internet Explorer 10, which will ship with the first batch of Windows 8 tablets later this year, you can call the window.navigator.msMaxTouchPoints method

为了测试Internet Explorer 10中的触摸,它将在今年晚些时候发布第一批Windows 8平板电脑,您可以调用window.navigator.msMaxTouchPoints方法

if (window.navigator.msMaxTouchPoints) {
// touch device
}
else {
// non-touch device
}