Cancel touchhend event when touchmove starts

I have a scrollable list in my web application using scrollability to work with the overflow:scroll function. although when I finish scrolling and pull my finger out of the screen, the event may also fire.

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

The fact is that I would only like this event to be higher, to shoot when the action there did not concern the event before that.

can I exclude touchend event from inside touchmove event? so does it better mimic iOS UITableView component? where when starting touchmove it cancels the target for touchend

+4
source share
1 answer

Set the touchmove flag, which can be tested in touchend , and if the flag is set, just skip the functionality and possibly preventDefault() (in any case, reset the flag at the end).

+8
source

Source: https://habr.com/ru/post/1400752/


All Articles