I'm building a web iPhone app that involves changing the viewport on demand with Javascript. I do this by changing the content attribute of the tag. This works well most of the times, except when orientation change is involved.
Everytime I try to change the viewport after an orientation change event, the page doesn't zoom to it's full size anymore, and a checkered background appears.
Here's a way to reproduce this:
- Go to http:// daedalus.rcboyce.com/viewport/
- Resize to 980 (iPhone's default)
- Resize to 320 (works)
- Resize back to 980
- Go to landscape mode
- Go to portrait mode back again
- Resize to 320 (fails every time I tried)
Here's a screenshot of how it looks: http://tinypic.com/r/15qyzoh/6
Does anybody have any ideea why this is happening? Is this a MobileSafari bug, and if so, is there anyway to fix it?