Elevatezoom image does not scroll on cell phone

image of Elevatezoom not scrolling in a cell phone

When there is an image of the lifting connector and you want to scroll And you stand on the image with your finger It is impossible to scroll up or down on mobile phones

help is needed

+5
source share
2 answers

I searched to destroy ElevateZoom on mobile devices for better user convenience and ran into the same problem. I could not scroll the web page when I tried the image. I found that the touchmove event touchmove prevented by a normal function with the following code:

 b.$elem.bind("touchmove", function(a) { a.preventDefault(); b.setPosition(a.originalEvent.touches[0] || a.originalEvent.changedTouches[0]) }); 

I removed elevateZoom and did not touchmove with the following code.

  $('#imgzoom').removeData('elevateZoom'); $('.zoomWrapper img.zoomed').unwrap(); $('.zoomContainer').remove(); $("#imgzoom").unbind("touchmove"); 
+2
source

This works in elevateZoom 3.0.8:

In the elevatezoom.js file, find “touchmove” and “touchhend” and remove or comment on all the anchors that use these words. Now you can scroll through mobile devices (using touch), and the lens still works on the desktop.

0
source

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


All Articles