zoom icon indicating copy to clipboard operation
zoom copied to clipboard

Help with touchstart touchend

Open DrLulz opened this issue 9 years ago • 1 comments

Hello.
The first example works as expected, but once touchend has been called further zooming is disabled.
The second example needs two touches two initiate the zoom, but otherwise works as expected.
Any help is most appreciated.

$('img').parent().zoom({callback:
      function(){
        $(this).on('touchend', function(){
            $(this).trigger('zoom.destroy');
        });
      }
    });
$('img').parent().on('touchstart', function(){
        $(this).parent().zoom({callback:
          function(){
            $(this).on('touchend', function(){
                $(this).trigger('zoom.destroy');
            });
          }
        });
    });

DrLulz avatar Mar 26 '15 16:03 DrLulz

Try this:

var options = {callback:
      function(){
        $(this).on('touchend', function(){
            $(this).parent().trigger('zoom.destroy').zoom(options);
        });
      }
    };
$('img').parent().zoom(options);

cristianoap avatar Jan 25 '16 18:01 cristianoap