Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS5 Images disappear when scrolling with webkit-overflow-scrolling: touch

Tags:

I had previously been using iScroll plugin but wanted to drop it for the native behaviour.

The initial implementation was using

webkit-overflow-scrolling: auto; 

however I updated this to ...

webkit-overflow-scrolling: touch 

.. to enable the motion/inertia on the touch scroll.

The issue with this is the list items contained within the navigation disappear completely when scrolling, and only return once the momentum has come to a rest.

An example of this can be seen here

like image 984
justinavery Avatar asked Nov 13 '11 08:11

justinavery


2 Answers

I have had the same problem in the past, if you need to use positioned elements try adding -webkit-transform: translateZ(0); to the elements or the container. This property often forces the browser to use hardware acceleration and with the extra power your images will most likely not disappear. It worked for me anyway.

More useful stuff here too: http://www.html5rocks.com/en/tutorials/speed/html5/

like image 175
Mark Napthine Avatar answered Oct 26 '22 13:10

Mark Napthine


We tracked this down to elements that had position:relative or position:absolute. After we removed them the items would display while scrolling.

like image 27
EionRobb Avatar answered Oct 26 '22 15:10

EionRobb