My approach
So, I tried a lot, and I read even more about this issue. I ended up with a solution that is βOKβ for me (because it works), but which is definitely not close to βperfectβ.
When using this CSS:
.container { overflow: scroll; -webkit-overflow-scrolling: touch; }
you have a lot of problems with complex designs (in my case, a full-screen background image), and this gets even worse when using absolute positioned elements and iframes . (Which - of course - and the one I need).
So what is this trick? Basically this CSS:
.container > * { -webkit-transform: translate3d(0,0,0); }
With this rule, content was almost always provided immediately without getting these empty areas. Only when scrolling for the first time really fast does it flicker a bit.
But be careful with the -webkit-transform: translate3d(0,0,0); rule -webkit-transform: translate3d(0,0,0); . Using this rule to a large extent in many children, Safari started: sometimes it slowed down, but it crashed almost all the time. Itβs best to wrap all content elements in a single div , works great.
Are you done? Not really. There is also iframe -issue: ("argh")
IFrame
When the iframe not completely in the visible part of the container at the beginning, it is cropped or not even displayed at all. Sometimes this can happen while scrolling. So, I tried to get Safari to re-display this part at any time when the scrolling was completed, and came up with the following:
//using jQuery var container = $('#container'); var iframe = $('#iframe'); container.scroll( function (event) { iframe.css( 'marginLeft', 1 ); setTimeout( function() { iframe.css ( 'marginLeft', 0 ); }, 1 ); });
The thing with the scroll event on the touch device is that it only fires when the scroll ends, so this function does not start at any time, but when the pulse comes to an end. The short movement is not actually visible.
So perhaps this is useful for someone.
Additional Information
Here are some more links on this issue:
About how the scroll event fires in iOS:
javascript scroll event for iPhone / iPad?
Error message for Apple:
https://stackoverflow.com/a/7893031/1456376
iframe example with the same problem:
stack overflow