Comments (22)
Hmm, I'll have a look, thought that did work..
On 15 Dec 2012 17:49, "ozimmer" [email protected] wrote:
Is there a way to handle this as far as binding the 2 events separately on
the same element is not working ? thanks.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/50.
from touchswipe-jquery-plugin.
I confirm the issue, does not work for me either....
UPDATE: if I try and bind swipeLeft/Right/Up/Down and pinchIn/Out in the same block nothing works, if I bind the swipe and pinch events separately then only the swipe's get called.
from touchswipe-jquery-plugin.
Yeah, I'm having trouble with this as well.
Actually, I don't even really want both swipe and pinch events on the same element, but it seems there's no other way to get zooming to work on a multitouch mobile device (e.g. iPad) when touchswipe is used for swipe-support.
Zooming does work when I add an empty pinch function, but then swiping doesn't work anymore.
The demo page that says it allows zooming doesn't work on my iPad (iOS 5): http://labs.skinkers.com/touchSwipe/demo/10.1_Page_zoom.php - i can't zoom when I pinch inside the #test div on that page.
from touchswipe-jquery-plugin.
Really so sad I have to give up with this library and try to find another one which can handle both events.
from touchswipe-jquery-plugin.
I really love TouchSwipe, especially because the SwipeStatus en PinchStatus functions give you so much power and the plugin doesn't try to do more than is needed.
But these bugs surrounding pinching are really annoying. I'm sad too I might have to look for another touch-library because of this :'(
from touchswipe-jquery-plugin.
Let me know which one you found best martijn
from touchswipe-jquery-plugin.
Sorry guys, having some family issues that need my time at the moment, but back at work now and will try to solve the issue, just don't have that much free time at the mo . will have a look tomorrow if I can and see how much effort is involved. M.
from touchswipe-jquery-plugin.
TY matt do at your best, I think martijn and me really like your lib and this is just this feature that blocks us to go any further.
from touchswipe-jquery-plugin.
Thanks for replying, Matt and the best of luck to you. I'm only writing about this issue because I love your plugin so much :-) I really hope you can find out what's the cause of these swipe/pinch-issues and fix them.
from touchswipe-jquery-plugin.
Working on it now. Got it mostly sorted i think, however, if the user has
swipes and pinches, the tricky bit at the moment is distinguishing between
a 2 finger swipe or a pinch.
Just trying to write the logic that compares the touch data and try to
determine the intended gesture.
hopefully, one that is done, it should be ok.
On 11 January 2013 14:59, martijnfrazer [email protected] wrote:
Thanks for replying, Matt and the best of luck to you. I'm only writing
about this issue because I love your plugin so much :-) I really hope you
can find out what's the cause of these swipe/pinch-issues and fix them.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-12147430.
from touchswipe-jquery-plugin.
On the last issue now I think, and this is general to pinching in general.
If the user releases the pinch, and one finger comes up just before the other (which is very common) the plugin will get a bit confused in its calculations, either not seeing the completed pinch (as 2 fingers were not released) or getting the values wrong.
So, should I add a threshold of releasing fingers, say 250ms between them, and if both come up in that time then we take it as a pinch / swipe completed.
If one finger is still down after the threshold, we cancel the pinch / swipe that was running, and leave the new (single finger swipe) going until that is released.
Like wise, if they then put the second finger back on, we cancel the single finger swipe an enter either pinch or 2 finger swipe.
This means if you registered for all swipes (swipe) and the pinchIn / pinchOut events, the following would occur ..
User starts a 2 finger pinch, they release one finger, leaving the other down for over 250ms. They then release the other finger. The swipe method would trigger with a single finger swipe and NOT the pinch, as the pinch was effectively cancelled due to the delay.
Make sense? Any issues you can foresee with that approach?
from touchswipe-jquery-plugin.
That sounds ok, Matt. Very cool you're making progress with this :-)
from touchswipe-jquery-plugin.
when can we test this new behavior ?
from touchswipe-jquery-plugin.
Interesting question...
Now lets split the situation into three stages:
- action start -- when the fingers touch the screen
- action state -- fingers moving
- action end -- fingers are lifted off the screen
I think that each stage hare has a possibility of:
- fingers touching/lifting not at the same time
- fingers lifting and touching back again unintentionally
- fingers touching the screen during the action by accident
If we consider the described situation in these terms then there are three distinct timeouts here:
- fingers-down-timeout the amount of time to start an action, this also helps us determine how many fingers participate in the action
- fingers-lifted-timeout the amount of time a finger can the system notices
- fingers-up-timeout the amount of time to end the action (this one is the same)
(not sure if fingers-lifted-timeout and fingers-up-timeout can be combined... still thinking about this)
Adding these three with reasonable defaults should make most problems go away...
The only question left is how we handle the situation when "fingers-up-timeout" is passed, and I see these solutions:
- end one action and start another, e.g. one finger gets lifted during a two finger swipe for longer than both the "lifted" and "up" timeout, then we trigger the "swipe with two fingers" event and continue with a single finger swipe.
- continue and wait till all the fingers are lifted (the solution you are suggesting)
- cancel the whole thing -- not very natural so we'll ignore this ;)
I'd do this with something like a bool "finalizeEventOnFirstFingerLifted" option, if true then we trigger an event as soon as the number of fingers is different past the timeout, else the last finger lifted triggers the event.
So to sum things up, I'd say that the most flexible way to go here is to add:
- fingersDownTimeout
- fingersLiftedTimeout
- fingersUpTimeout (as I said before, this might be redundant)
- finalizeEventOnFirstFingerLifted -- bool option
from touchswipe-jquery-plugin.
Yeah, the finalizeEventOnFirstFingerLifted could be the way to go.
The issues with detection are further complicated as you can simultaneously detect swipes and pinches, and user can start and end swipes whilst pinching, and visa versa. So multiple gestures can all start and end all during one "session" as it were.
I think the simplest solution is to have a slight timeout on finger release to wait for a subsequent release, just to catch tiny delays in lifting multiple fingers.
And then add the finalizeEventOnFirstFingerLifted idea, so a developer has a bit more control over it.
from touchswipe-jquery-plugin.
Is there a time frame on this? ...I need to plan my work to either stall some features for a short time or workaround this temporarily depending on the expected delay...
I'm to rushing you or anything, but I need at least a a guesstimate for planning ;)
Thanks!
from touchswipe-jquery-plugin.
I can push a version for testing on Monday morning, along with new
documentation and demos.
Not tested much yet, but basically allows you to run pinch and swipe status
events at the same time.
Will updated you when its in.
Matt.
On 19 Jan 2013 18:57, "Alex A. Naanou" [email protected] wrote:
Is there a time frame on this? ...I need to plan my work to either stall
some features for a short time or workaround this temporarily depending on
the expected delay...
I'm to rushing you or anything, but I need at least a a guesstimate for
planning ;)Thanks!
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-12459280.
from touchswipe-jquery-plugin.
That would be great!
Then I'll do some testing on my projects, will let you how it works,
hopefully by Wednesday :)
On Sat, Jan 19, 2013 at 11:32 PM, Matt Bryson [email protected]:
I can push a version for testing on Monday morning, along with new
documentation and demos.Not tested much yet, but basically allows you to run pinch and swipe
status
events at the same time.Will updated you when its in.
Matt.
On 19 Jan 2013 18:57, "Alex A. Naanou" [email protected] wrote:Is there a time frame on this? ...I need to plan my work to either stall
some features for a short time or workaround this temporarily depending
on
the expected delay...
I'm to rushing you or anything, but I need at least a a guesstimate for
planning ;)Thanks!
—
Reply to this email directly or view it on GitHub<
https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/issues/50#issuecomment-12459280>.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-12459798.
Alex.
from touchswipe-jquery-plugin.
The branch 1.6.x has the latest changes (https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/tree/1.6.x).
It also now has locally running Demos and Documentation (finally!), so check the Demo for Swipe and Pinch to see both status handlers running at the same time.
There is a threshold now for the pinch, so if the user is swiping and pinching, well allow a subtle pinch threshold as you always pinch slightly when doing a 2 finer swipe. This is all configurable, and in the docs.
Ive run over all the demos and they appear to be running, but Ive not had time to fully test on different OS's, platforms etc etc. SO there may well be some issues.
m.
from touchswipe-jquery-plugin.
Make sure you check the local demo in the repo, NOT the link to the labs site, as I have not updated those yet.
from touchswipe-jquery-plugin.
hi matt, I am using touchswipe.js for the first time. I want to zoom-in(maximize) the image when i pinch the image and aslo want to zoom out. How to do this using the pinch method. Can please explain and give a sample code on this???
from touchswipe-jquery-plugin.
hi, Marti..????
from touchswipe-jquery-plugin.
Related Issues (20)
- Version number is incorrect HOT 2
- Touchswipe interfering with html widget calendar date picker?
- Uses Passive Event Listeners to Improve Scrolling Performance HOT 4
- Uncaught TypeError: $(...).swipe is not a function HOT 3
- Package json "licenses" field uses invalid format, use SPDX expressions instead HOT 1
- hold not firing after longTapThreshold is reached
- carousel bootstrap swipe touch with include slider file to master page
- Uncaught TypeError: ((n.event.special[g.origType] || {}).handle || g.handler).apply is not a function
- non-standard property "zoom" HOT 1
- What is the best way to remove a swipe handler from a page?
- On swipe is phase end not firing
- Ignored attempt to cancel a touchmove event with cancelable=false
- Need help to disable horizontal swiping, please
- minified version doesn't correspond
- Moving range slider right, invokes swiperight HOT 1
- Adding Class To Dom HOT 1
- triggerOnTouchLeave on Android gets script stuck HOT 1
- j
- yos
- How to hang an event on new DOM elements
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 touchswipe-jquery-plugin.