I\'m working on a mobile website which has \"pages\" that have div\'s which take up the screens full size and you can scroll between each one. The problem is, the window resizes
You can wrap your HTML with div
and do something like this: http://jsfiddle.net/DerekL/Fhe2x/show
$("html, body, #wrapper").css({
height: $(window).height()
});
It works on Android and iOS.
The simplest way to achieve this is to scroll in a container, rather than scrolling the document.
E.g.:
<html><body>
<div id="scrollable-content"> ... all your content here ... </div>
</body></html>
html, body {
height: 100%;
}
#scrollable-content {
height: 100%;
overflow-y: scroll;
}
Are you looking at iPhone? I don't know about Android, but on iOS 7 for iPhone it's not possible. One thing you could do is use minimal-ui
to have an always-minimized navigation bar, keeping a consistent size for the window:
<meta name="viewport" content="width=device-width, minimal-ui">
http://visuellegedanken.de/2014-03-13/viewport-meta-tag-minimal-ui/
I hope that helps!