elevatezoom icon indicating copy to clipboard operation
elevatezoom copied to clipboard

Zoom on touch

Open satb opened this issue 12 years ago • 7 comments

Right now, on mobile touch enabled devices, we have to first tap, then pan around for the zoom to take effect. If we simply touch and start dragging, the zoom is not functioning but rather iPad/iPhone ask to copy/paste by selecting the div container.

Any idea how we can get it to work without having to first tap and then pan around? We should be able to touch and zoom immediately (i.e don't need to lift finger off the screen with a first tap on the screen first).

satb avatar Mar 25 '13 01:03 satb

I second this issue. I thought it wasn't working at all on my touch screen until I saw what was posted here, then I tried and it will indeed work after the first tap.

Seems like a bug. Supporting touch screens is important and increasing in importance.

NightOwl888 avatar Nov 16 '13 01:11 NightOwl888

This plugin seems to be dead/dying, but just in case this helps anyone, here's what I added to get around this.

self.zoomContainer.bind('touchmove', function(e){
    self.overWindow = true;
    b.setElements('show');
});

There's still some issues with the zoom window stuttering or not opening on the first try. I believe this is due to Android devices firing multiple events on the first tap before touchstart (mouseenter and mouseclick). It's a bit of a rats nest.

kevana avatar Jun 27 '14 16:06 kevana

What plugin do you recommend? I'm looking for a zoom, that works on touch devices. Or maybe working with RoyalSlider Plugin.

estebandinamarca avatar Oct 16 '14 14:10 estebandinamarca

I haven't researched options in a while, maybe check out https://github.com/jackmoore/zoom.

kevana avatar Oct 16 '14 14:10 kevana

We had the same issue of wanting touch start. If you have an issue with android firing multiple touchstart events just use a debounce, https://davidwalsh.name/function-debounce, and set it to the appropriate interval.

var debouncedTouchStart = debounce(function(e) { self.overWindow = true; b.setElements('show'); }, 250);

self.zoomContainer.bind('touchstart', debouncedTouchStart);

not fully tested but should work/help.

jasonlafferty avatar Feb 19 '16 12:02 jasonlafferty

any update ? I wanna zoom when I touchstart and move on tablet.

chinhphan099 avatar Jul 18 '16 04:07 chinhphan099

The fix above didn't work for me, this did tho:

self.$elem.bind('touchstart', function(e){
  if(self.options.zoomType == "inner") {
    self.showHideWindow("show");

  }
  e.preventDefault();
  var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];  
  self.setPosition(touch); 
});

It's a copy-paste from zoomContainer's touchmove. You probably don't need all of it.

tostercx avatar Aug 26 '16 23:08 tostercx