有没有什么好的、干净的方法或技巧来发现用户是否在使用触摸屏设备?
我知道有像var isiPad = navigator.userAgent.match(/iPad/i) != null;这样的东西
但我只是想知道是否有一个技巧来确定用户是否在使用Touch设备?因为市场上的触控设备和平板电脑比iPads多得多。
谢谢。
发布于 2013-04-17 18:44:48
if ("ontouchstart" in document.documentElement)
{
alert("It's a touch screen device.");
}
else
{
alert("Others devices");
}我在到处浏览后发现的大多数简单代码
https://stackoverflow.com/questions/6262584
复制相似问题