如果我使用-webkit-overflow-scrolling,Div滚动有时会冻结 [英] Div scrolling freezes sometimes if I use -webkit-overflow-scrolling

查看:143
本文介绍了如果我使用-webkit-overflow-scrolling,Div滚动有时会冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用 -webkit-overflow-scrolling 作为滚动div,它会以原生动量完美滚动。但是,div本身有时会冻结并且不会响应我的手指移动。 2-3秒后,它再次变为可滚动。

if I use -webkit-overflow-scrolling for a scrolling div, it scrolls perfectly with native momentum. But, div itself sometimes freezes and does not respond my finger moves. After 2-3 seconds later, it becomes again scrollable.

我不知道我是如何重现这个问题的。但是,正如我所看到的,有两种主要行为会造成这种情况。

I dont know how I am reproducing this problem. But, as I see there are two main behaviour creates this situation.

首先,如果我等待一段时间,例如20秒,然后触摸div,它就不会响应。我等了几秒钟,它又恢复了工作。

First, If I wait for a while, for instance 20 seconds, and touch the div, it does not respond. I wait couple of seconds, and it becomes working again.

其次,我快速触摸几次,然后,它变得冰冷,再过几秒钟后,它再次开始工作。

Second, I touch several times quickly, and then, it becomes freezing, and again, after couple of seconds later, it starts working again.

如何防止这种冻结?

推荐答案

这是未解决的问题,其链接可在此处找到 ios

This is an open issue whose link can be found here issue in ios

此问题的解决方案之一可以在此GitHub链接中找到
github

One of the Solutions to this problem can be found here in this GitHub link github

根据发现的问题上面发布的GitHub链接 - 可以跟踪几个步骤来消除滚动问题。

According to the issues found in the GitHub links posted above - Few steps can be traced to remove the scrolling issue.


  • 评论输出 ionic.js

self.el.style.overflowY = 'hidden';

self.el.style.overflowX = 'hidden';


  • 使用 cordova.plugins.Keyboard.disableScroll(true)通过键盘滚动
    而不会中断

  • Use cordova.plugins.Keyboard.disableScroll(true) for scrolling through the keyboard without interruptions

    $ ionicConfigProvider.scrolling.jsScrolling(true) 在配置部分将此设置为true。

    $ionicConfigProvider.scrolling.jsScrolling(true) Set this to true in the config part.

    此外,在某些情况下,overflow-scroll设置为hidden但不是再次设置为滚动,这会使屏幕冻结。

    Also Under some circumstances, overflow-scroll is set to "hidden" but not set back to "scroll" anymore which makes the screen freeze.

    希望它可以帮到你。

    / *对我来说是必要的措施,这不包括答案* /

    /* Necessary measures for me,this excludes the answer */

    / *我在此声明完全归属于上述链接中所述的github发布页面* /

    /* I hereby state full attribution to be given to the github posted pages stated in the link as above*/

    这篇关于如果我使用-webkit-overflow-scrolling,Div滚动有时会冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆