Reputation: 2897
I understand that "portrait" iPad orientation corresponds to a window 1024px wide, and 768px for "landscape".
However I have always the same width regardless of my iPad orientation when I visit my web page.
At the left bottom, the number in red color represents the value of jQuery('body').width()
connected to the resize()
JS event. Why does the value remain the same in both portrait and landscape modes?
Upvotes: 0
Views: 116
Reputation: 1526
Instead of using jQuery to change the style of your page you should consider using Sass Media Queries.
http://thesassway.com/intermediate/responsive-web-design-in-sass-using-media-queries-in-sass-32
http://thesassway.com/intermediate/responsive-web-design-part-2
It is simpler and doesn't rely on js events and code manipulation.
Hope it helps, Cheers.
Upvotes: 0
Reputation: 16563
You need to add initial-scale=1
to your meta viewport
tag. See this related question: Viewport meta tag for iOS devices
Upvotes: 1