![](/img/trans.png)
[英]What's the best way to detect a 'touch screen' device using JavaScript?
[英]What is the best way to detect mobile screen width using JavaScript
使用JavaScript检查移动屏幕宽度的最佳方法是什么? 我已经尝试过screen.width,但结果不一。
您可以在HandsetDetection.com上使用Javascript移动检测方法。 创建没有重定向规则的网站配置文件,并将检测javascript嵌入页面中。 然后,您可以直接从javascript访问HandsetDetection.width和HandsetDetection.height变量以实现屏幕分辨率。
希望能有所帮助。
(免责声明:我在那儿工作)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.