Comments (2)
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.
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:
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)
- Why does this plugin always prevent the default action? HOT 2
- Prevent default causing page scrolling lock HOT 1
- "Up" and "down" directions reversed HOT 1
- NPM? HOT 2
- Propagate touch events to underlying layers (under the layer that captures the swipe events) so that buttons and links still work? HOT 2
- detect_swipe prevents Firefox from scrolling page vertically when vertical swiping HOT 2
- Google recommends using what they call "passive listeners" for touch handlers on mobile devices HOT 1
- Vertical Scrolling not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detect_swipe.