gpt4 book ai didi

javascript - touchmove开始时取消touchend事件

转载 作者:可可西里 更新时间:2023-11-01 05:15:13 26 4
gpt4 key购买 nike

我的网络应用程序中有一个可滚动列表,使用 scrollability处理 overflow:scroll 特性。虽然当我完成滚动并将手指从屏幕上移开时,下面的事件也会触发。

$('li').live('touchend', function (e) {
//...
});

问题是我只希望在操作之前没有 touchmove 事件时触发上面的事件。

可以从 touchmove 事件中抑制 touchend 事件吗?所以它能更好地模拟 iOS UITableView 组件?当 touchmove 开始时,它会取消 touchend

的目标

最佳答案

touchmove 中设置一个标志,可以在 touchend 中测试,如果设置了标志,则跳过该功能并可能跳过 preventDefault()(无论哪种方式,都在最后重置标志)。

关于javascript - touchmove开始时取消touchend事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9648863/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com