The latest iOS 5 update has brought changes to the way certain CSS properties are handled. It is now possible to use overflow:scroll
or position:fixed
and achieve the desired effect. For instance, consider this snippet of code:
<header style="
position: fixed; top: 0; left: 0;
width: 100%; height: 20px; font-size: 20px">
Heading
</header>
<article style="margin: 20px 0">
Your content here
</article>
<footer style="
position: fixed; bottom: 0; left: 0;
width: 100%; height: 20px; font-size: 20px">
Footer
</footer>
This code should function as intended without any issues. However, it is worth noting that there are still older devices running previous versions of iOS. In such cases, it might be wise to implement lazy loading using Scrollability for these devices. You can test for older iOS versions using the following JavaScript snippet:
var isios = navigator.appVersion.match(/CPU( iPhone)? OS ([0-9]+)_([0-9]+)(_([0-9]+))? like/i);
// if successful, it typically returns ["CPU OS X_Y_Z like",undefined,X,Y,Z]
if (isios && isios[2] < 5){
// load scrollability here. Example using jQuery:
$.getScript("/js/scrollability.min.js", function() {
// code to execute after scrollability has loaded
}
}