zoom
zoom copied to clipboard
Help with touchstart touchend
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');
});
}
});
});
Try this:
var options = {callback:
function(){
$(this).on('touchend', function(){
$(this).parent().trigger('zoom.destroy').zoom(options);
});
}
};
$('img').parent().zoom(options);