Zynga Scroller - cell click detection

I cannot find any examples on github or when I search on Google to detect click events for the Zynga scroller.

For example, starting with Pull-to-refresh , it contains this code:

if ('ontouchstart' in window) { container.addEventListener("touchstart", function(e) { scroller.doTouchStart(e.touches, e.timeStamp); e.preventDefault(); // Problem !!! }, false); 

Since we always prevent Default, I can never click a line in a scrollable list. If I delete this line, I can click, but then scrolling does not work.

Is there any other way to detect a click?

(It works on a computer, but not on a smartphone with an ontouchstart event (iPhone 4s))

+4
source share
2 answers

This is because the scrollerObject function prevents user actions, depending on the Zynga scroller plugin used, which you use, for example, on EazyScroller.js, look for that.scroller.doTouchStart(e.touches, e.timeStamp) code that.scroller.doTouchStart(e.touches, e.timeStamp) and delete e.preventDefault () on the following line:

that.scroller.doTouchStart (e.touches, e.timeStamp);
//e.preventDefault ();

+1
source

Check on e.preventDefault(); on touchstart warning.

Comment and add the function e.preventDefault(); in touchmove .

It helps me.

+1
source

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


All Articles