drake035
drake035

Reputation: 2897

iPad physical orientation doesn't have any effect

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

Answers (2)

Lucas Lazaro
Lucas Lazaro

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

sinelaw
sinelaw

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

Related Questions