I am using a JQuery parallax slider effect. Everything fits the screen on iPad except when I rotate from landscape to portrait there is a about a 120px right margin that pushes my slider content over to the right.
I have tried setting viewport tag
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
but this did nothing. when I go to the page directly in portrait it is fine. The right margin is only added when I rotate from landscape to portrait. Portrait to landscape resizes appropriately.
here is example
demo
A quick, dirty fix would probably be to execute a method to reset the margins when the
onorientationchangeevent is triggered on thebody.So example code would be as follows:
Obviously this is not ideal and you would prefer an explanation for why this happens. But I just thought I’d suggest this as a quick fix