問題描述
我之前一直在使用 iScroll 插件,但想放棄它以適應原生行為.
I had previously been using iScroll plugin but wanted to drop it for the native behaviour.
最初的實現是使用
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
推薦答案
我之前也遇到過同樣的問題,如果你需要使用定位元素嘗試添加 -webkit-transform: translateZ(0);
到元素或容器.此屬性通常會強制瀏覽器使用硬件加速,并且借助額外的功能,您的圖像很可能不會消失.無論如何,它對我有用.
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.
這里還有更多有用的東西:http://www.html5rocks.com/en/tutorials/speed/html5/
More useful stuff here too: http://www.html5rocks.com/en/tutorials/speed/html5/
這篇關于使用 webkit-overflow-scrolling 滾動時 iOS5 圖像消失:觸摸的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!