topmonkey — 2013-02-09T10:39:12-05:00 — #1
I am currently building a responsive website which I decided to test on my Galaxy Ace 2. I am using media queries to change various elements at different window / browser sizes. One such change triggers between the portrait and landscape sizes on my Ace 2. If I view my website in landscape orientation and then rotate to portrait, the Ace 2 sometimes keeps the CSS used in landscape mode, and vice versa.
The only solution I have found is to reload the window:
window.onresize = function(event)
But this creates a delay every time the device is rotated.
Is there anything I can do about this?
topmonkey — 2013-02-10T05:23:53-05:00 — #2
The above also doesn't work well because it forces a page refresh on scrolling too.
topmonkey — 2013-02-10T06:01:29-05:00 — #3
From reading elsewhere online (http://moduscreate.com/orientation-change-zoom-scale-android-bug/) it appears it may have someting to do with the viewport meta tag not being reset on device orientation. However, the fix they suggest doesn't work (even after corrected the missing bracket from their code).
The other weird thing about it is that the bug only occurs when you follow this sequence:
1) Load website in portrait (displays fine with zoom disabled).
2) Rotate to landscape (displays fine with zoom disabled).
3) Rotate back to portrait (displays as it would in landscape with zoom enabled).
If you load the website in landscape then rotate, it displays fine, no matter how many rotations you perform.