为什么在iPhone 4上报980?我以为是960或640.
alert($(window).width());
解决方法
您将获得默认视口设置.请参阅
Apple iOS docs – meta tag并搜索“视口”.
Property Description
width The width of the viewport in pixels. The default is 980. The range is from 200 to 10,000. You can also set this property to the constants described in “number.”
Available in iOS 1.0 and later.
要获取设备宽度,请按照以下说明:
For example,to set the viewport width to the width of the device,add this to your HTML file:
<Meta name="viewport" content="width=device-width" />