Zoom in ipad with Javascript

Asked

Viewed 48 times

0

I have an HTML5 presentation that runs on iPad with slide controls on 'Swipe' (Swipe right or left). However, when Swipe occurs, the slide becomes loose. I added the following code to truncate:

    $(document).ready(function() {
        $(".wrapper").bind('touchmove', function (e) {
        e.preventDefault();
        return true;
        });
    });

Only with this code, the zoom (Pinch) stops working. Is there any way to enable the zoom with this code inserted?

That’s the code that doesn’t work.

node.addEventListener('gestureend', function(e) {
if (e.scale < 1.0) {
    // User moved fingers closer together
} else if (e.scale > 1.0) {
    // User moved fingers further apart
}
}, false);
  • The code you put in the question, I don’t know how you applied it, I don’t know what your page code looks like, I don’t know what your slides look like, and I can’t reproduce the problem, either. Please give us something that we can RUN and test the problem first please. The problem could be anything.

  • I think I was not very clear. : / The first code truncates the page, that is, when it slides to the side it is not 'sambando' on the screen. But for the zoom to work, you need to touch and make the pincer movement. The problem is that the first code overwrites the first one. I wanted to find a way to make some conditional action, I don’t know. Type: if(pincer movement) { applies zoom} otherwise { does not zoom}

  • The problem you already explained right friend, now just need to give a code that we can reproduce the problem and find the origin of the fault, or that we can elaborate a code on top of "tests". I hope you understand ;)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.