zoom icon indicating copy to clipboard operation
zoom copied to clipboard

Problems on iOS

Open d2s opened this issue 13 years ago • 2 comments

Tested how this little thing works and while it works nicely on desktop browsers, had some interesting problems on Mobile WebKit (iOS 5.0.1) running on iPad. When tapping image content area, it zooms to the one specific point but it isn't possible to move the zoomed image around. It could be possible with ontouchmove –type of event triggers.

Understandably there aren't support for touch based browsers at the moment. If someone is interested of trying to add that, there is more details on Safari Web Content Guide about differences in the way how WebKit handles touch based events.

d2s avatar Nov 26 '11 12:11 d2s

I did a quick fix for this when using the plugin on the "on click" event. I did not submit a Pull Request, because I feel this is way too raw to be included in the main code.

My fix was to change the beginning oh the move function (starting from a line 62) to look like this:

function move(e) {
    if (e.type == 'touchmove')
    {
        left = (e.originalEvent.touches[0].pageX - offset.left);
        top = (e.originalEvent.touches[0].pageY- offset.top);
    }
    else
    {
        left = (e.pageX - offset.left);
        top = (e.pageY - offset.top);
    }

    if (left > outerWidth) {
        left = outerWidth;
    } else if (left < 0) {
        left = 0;
    }

and starting from line 151

start(e);

$(document)[mousemove](move);
$(document).on('touchmove', move);

$(document).one('click',
    function () {
        stop();
        clicked = false;
        $(document).unbind(mousemove, move);
        $(document).off('touchmove', move);
    }
);

Luoti avatar Feb 11 '13 08:02 Luoti

This code (move function) is now updated. However the problems on IOS (chrome) still exist. I can zoom the image one of 10 times. Another 9 times the zoom is reset in fraction of the second.

gonzzza007 avatar Sep 12 '17 12:09 gonzzza007