lightslider icon indicating copy to clipboard operation
lightslider copied to clipboard

Prevent Sliding while scrolling vertically on a touch device

Open Dani8888 opened this issue 5 years ago • 1 comments

Hi, the title says it all, can anyone fix this? Thanks in advance.

Dani8888 avatar Mar 16 '19 16:03 Dani8888

i cloned repo and changed lightslider.js ` $slide.on('touchmove', function (e) { if (w < elSize) { if (w !== 0) { return false; } } var orig = e.originalEvent; endCoords = orig.targetTouches[0]; var xMovement = Math.abs(endCoords.pageX - startCoords.pageX); var yMovement = Math.abs(endCoords.pageY - startCoords.pageY); if (settings.vertical === true) { if ((yMovement * 3) > xMovement) { e.preventDefault(); } $this.touchMove(endCoords.pageY, startCoords.pageY); } else { if (xMovement > settings.swipeThreshold) { e.preventDefault(); $this.touchMove(endCoords.pageX, startCoords.pageX); } }

                });

`

pan1982 avatar Jun 17 '20 12:06 pan1982