使用 webkit-overflow-scrolling 滚动时 iOS5 图像消失:触摸

2023-03-25移动开发问题
31

本文介绍了使用 webkit-overflow-scrolling 滚动时 iOS5 图像消失:触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我之前一直在使用 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 图像消失:触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)...
2024-08-12 移动开发问题
13