果冻豆的WebView应用程序不响应完美touchend事件 [英] Jelly Bean webview app does not respond to touchend events perfectly

查看:286
本文介绍了果冻豆的WebView应用程序不响应完美touchend事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的WebView应用程序正常工作与Android版本touchend事件比果冻豆旧。但是在果冻豆的touchend事件是不可靠的。特别是对那些滚动的div中,touchend事件不会有时解雇,整个应用程序停止响应任何touchend事件和我得到的标签webcoreglue和文本日志消息不应该发生:没有基于RECT-测试节点发现
现在,我以后连滚动一点,它开始应对正常touchend。
请帮助。

My webview app works fine with touchend events in android version older than Jelly Bean. But in Jelly Bean, the touchend events are not reliable. Especially on divs that are scrollable, the touchend events are not fired sometimes and the whole app stops responding to any touchend events and I get the Log message with the tag "webcoreglue" and text "Should not happen: no rect-based-test nodes found" Now after i scroll even little bit, it starts responding to touchend normally. Pls help.

HTML

<div id="srpanel" class="panel">
    <div class="main sr-list">
        <div class="sr-list-item-action">
        </div>
    </div>
</div>

JS

$('.sr-list-item-action').bind('touchend', function(){
//some code
});

我使用div'SR-列表项行动中的for循环列表中的每个项目。
因此,点击列表中的一个项目只能部分时间。否则,当它不工作,整个画面实际上是冻结,停止接收任何touchend事件,直到我滚动。
我观察到其他的事情,这种情况更多的时候我做了的$(document).scrollTop(); 当我去到列表中的下一个页面。不知道这是相关的。

I am using the div 'sr-list-item-action' in a for loop for each item in the list. So, clicking on an item in the list works only some times. Otherwise when it doesn't work, the whole screen is actually frozen and stops receiving any touchend events, until i scroll. Other thing i observed is, this happens more when i do a $(document).scrollTop(); when i go to the next page of the list. Not sure if this is related.

推荐答案

有完全相同的问题。许多不眠之夜后,这救了我:

Had the exact same problem. After many sleepless nights this saved me:

window,html,body {
    overflow-x:hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overflow: scroll !important;
}

这篇关于果冻豆的WebView应用程序不响应完美touchend事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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