From 44e901d559dd1491a148a2671ea813cd93e6a371 Mon Sep 17 00:00:00 2001 From: "Toerd@480" Date: Thu, 24 Oct 2019 00:25:52 +0200 Subject: [PATCH] Maybe touch works correctly --- inc/js/zoom.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/js/zoom.js b/inc/js/zoom.js index 5a98a4d..3c5fb16 100644 --- a/inc/js/zoom.js +++ b/inc/js/zoom.js @@ -25,11 +25,12 @@ function zoom(factor, imgName) { img.style.opacity = 0; }); - img.addEventListener("mousemove", (e) => { + img.addEventListener("touchmove", (e) => { + e.preventDefault(); moveBackground(getOffsetToMiddle(e)); }); - img.addEventListener("touchmove", (e) => { + img.addEventListener("mousemove", (e) => { moveBackground(getOffsetToMiddle(e)); });