ryanve / response.js

Responsive design toolkit
http://responsejs.com
Other
801 stars 123 forks source link

why window.screen.width is 320 on iphone 5? #33

Closed dfang closed 10 years ago

dfang commented 10 years ago

I use iPhone to visit responsejs.com/labs/dimensions/, but why window.screen.width is 320 instead of 640, and window.screen.height is 480 instead of 960 ?

who can explain this ?

thanks !

ryanve commented 10 years ago

@dfang 320 is correct because 2 === window.devicePixelRatio on the iPhone. Test the media query.