如何找到移动设备的屏幕空间?
我计划为我的网站开发移动版本,我需要考虑所有设备,例如具有不同屏幕尺寸的设备。我试图找到一种方法来获取移动设备的实际宽度,以相应地适应我的移动网站,任何人都可以为这个问题提出解决方案吗?如果我使用 jQuery 或 PHP 找到了这个问题的解决方案,我会非常高兴,因为我正在使用它们来开发我的移动网站。
I'm planing to develop mobile version for my website, I need to consider all the devices like with different screen dimensions. I tried to find out a way to get the real estate width of mobile devise to shoe my mobile site accordingly, can anybody please suggest a solution for this problem. I'll be very happy if I got some solution to this problem using jQuery or PHP because I'm using these to develop my mobile website.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要使用 JavaScript,而是使用 CSS3 媒体查询来定位不同的屏幕尺寸,例如:
更新: 如果确实有必要,请使用
screen.width
和screen.height< /code> 访问屏幕的宽度和高度。
W3C CSS3 媒体查询
Instead of using JavaScript, use CSS3 media queries to target different screen sizes, for example:
Update: If really necessary, use
screen.width
andscreen.height
to access the width and height of the screen.W3C CSS3 Media Queries