admin管理员组

文章数量:1391925

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.

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

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.

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

Share Improve this question edited Sep 15, 2012 at 11:53 MikkoP 5,09217 gold badges61 silver badges108 bronze badges asked Sep 15, 2012 at 11:41 AnoopAnoop 23.2k10 gold badges64 silver badges79 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

See here: Detecting Touch Hardware in 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

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

本文标签: javascriptHow can I detect if a screen is touch sensitiveStack Overflow