Coder Social home page Coder Social logo

Comments (2)

marcandre avatar marcandre commented on July 28, 2024

I didn't realize that multi-touch is supported by browser events, but apparently it is, using pointer events: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events/Pinch_zoom_gestures
I do not know if detect_swipe interacts with them, but if you turn off $.detectSwipe.preventDefault it shouldn't interfere.

Good luck

from detect_swipe.

loupiote avatar loupiote commented on July 28, 2024

Well, it does interfer.

When you pinch to zoom up, it will trigger swipe events.

You can test on my photo site, that uses your plugin for swipes, e.g. on this page:

https://www.loupiote.com/photos/gooseneck-chico-river-bend-in-the-cordillera-philippines-34814606526.shtml

Or on a phone, just go to www.loupiote.com and click on my face to get to a photo page!

swipe right/left navigates in the photo album. But when you zoom up/down if often triggers a swipe, because some pinching gestures still generate touch events that are caught by the plugin.

This seems to happen more often when you pinch to zoom down while the page is already zoomed to its minimum (i.e. default) size. In that case, the touch events are not captured upfront by Chrome mobile, and they generate unwanted swipe right/left.

I also managed to make it work so that you can still scroll the pages up/down on Firefox mobile, as I explained. I believe it is needed that the handlers return "true" in that case.

On chrome, the up/down touch gestures seems to be captured up-front causing pages to scroll (and zoom), so i believe that it is impossible to get swipe up/down events with the plugin unless your page is set at a "fixed" Y position i.e. not scrollable, regardless of whether you enable /disable default processing (because Chrome processes the events upfront). So $.detectSwipe.preventDefault has no effect at all on the way Chrome processes the touch event upfront, for page scrolling and zooming...

from detect_swipe.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.