From 8b0af7121a8bd510e21e6e44a47ba31481cb22f9 Mon Sep 17 00:00:00 2001 From: "Toerd@480" Date: Thu, 24 Oct 2019 00:21:57 +0200 Subject: [PATCH] added touch support for zoom --- inc/js/zoom.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/js/zoom.js b/inc/js/zoom.js index bd78573..5a98a4d 100644 --- a/inc/js/zoom.js +++ b/inc/js/zoom.js @@ -29,6 +29,10 @@ function zoom(factor, imgName) { moveBackground(getOffsetToMiddle(e)); }); + img.addEventListener("touchmove", (e) => { + moveBackground(getOffsetToMiddle(e)); + }); + img.addEventListener("mouseleave", (e) => { img.style.opacity = 1; });