Comments (10)
Thanks for your @hotmeteor.
At present, without editing the source of the library, there's no way to change the threshold for swipe
events. I'll push a new version this evening which allows you to pass in the threshold (either vertical or horizontal) to the swipe
events. I'll close the issue once it's been done.
Thanks again for your suggestion!
Ben
from jquery-touch-events.
I have now added support for defining custom thresholds to be used in conjunction with swipe
events. You will need to add an attribute to the target element to define this as follows:
data-xthreshold
is for the horizontal threshold.
data-ythreshold
is for the vertical threshold.
You can see a jsFiddle of the new functionality in action here > http://jsfiddle.net/benmajor/4JaTD/. I have also added documentation about this in the readme.md
file.
Let me know what you think, and hopefully it'll cure your issue with overflow / scrolling.
Thanks again,
Ben.
from jquery-touch-events.
Yes, that's great. Thanks a ton.
Ok, so here's my exact scenario... I have a list of items on a page that each need to be swiped on. Because I have swipeleft
and a swiperight
on each item, it's blocking scroll. I figured out a way around it, and it was a combo of the thresholds and a new setting I added called a scrollThreshold
. I use this in a calculation and modified the swipe
events to check if the angle of the swipe is more horizontal than vertical.
All this to say...
- I will commit a pull request with my change (once I refresh myself on how to do it exactly).
- I think I need a way to override settings with a default ($.extend?) for all swipe events. Or pass in an option object with an event call, much like plugin options.
Is this making sense? Sorry if I've diverted this issue.
from jquery-touch-events.
I am running into the same problem. Setting the threshold didn't change anything. If I remove the call of preventDefault() on the touchMove function, I am able to scroll, but the event handling doesn't really work anymore. Has there been any real solition for it?
from jquery-touch-events.
Could you please put together a jsFiddle of your sample for me to have a look over?
from jquery-touch-events.
It looks like this is become a real issue now, as a number of people are reporting the same problem. I'll look at it tomorrow and try to push a new version, but in the meantime I will reopen this issue until I can find a decent solution / workaround.
from jquery-touch-events.
I have now pushed a new version of the code, which should now fix the issues with scrolling and swipe
events. Instead of preventing the default behaviour for touchMove
, the swipe*
events are handled in the touchMove
.
This should fix the issue, and I have tested on iOS 4 and 5 (both on iPad and iPhone), so I am closing this. In case you run into any further problems, please start a new issue here based on the revised code.
from jquery-touch-events.
After the update, a swiperight event is fired everytime I move the mouse (on pc) no matter if klicked or not. And sometimes the swipe event seems to be fired twice (maybe caused by problem 1)
----- Ursprüngliche Nachricht -----
Von: Ben Major
Gesendet: 07.01.2013 01:02
An: benmajor/jQuery-Mobile-Events
Cc: miladiehexe
Betreff: Re: [jQuery-Mobile-Events] swipeleft/swiperight blocking page scroll (#5)
I have now pushed a new version of the code, which should now fix the issues with scrolling and swipe
events. Instead of preventing the default behaviour for touchMove
, the swipe*
events are handled in the touchMove
.
This should fix the issue, and I have tested on iOS 4 and 5 (both on iPad and iPhone), so I am closing this. In case you run into any further problems, please start a new issue here based on the revised code.
Reply to this email directly or view it on GitHub:
#5 (comment)
from jquery-touch-events.
Thank you for brining this to my attention. I am going to look into it.
On 7 January 2013 08:48, miladiehexe [email protected] wrote:
After the update, a swiperight event is fired everytime I move the mouse
(on pc) no matter if klicked or not. And sometimes the swipe event seems to
be fired twice (maybe caused by problem 1)----- Ursprüngliche Nachricht -----
Von: Ben Major
Gesendet: 07.01.2013 01:02
An: benmajor/jQuery-Mobile-Events
Cc: miladiehexe
Betreff: Re: [jQuery-Mobile-Events] swipeleft/swiperight blocking page
scroll (#5)I have now pushed a new version of the code, which should now fix the
issues with scrolling andswipe
events. Instead of preventing the default
behaviour fortouchMove
, theswipe*
events are handled in the
touchMove
.This should fix the issue, and I have tested on iOS 4 and 5 (both on iPad
and iPhone), so I am closing this. In case you run into any further
problems, please start a new issue here based on the revised code.
Reply to this email directly or view it on GitHub:
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-11944346.
from jquery-touch-events.
This has now been fixed in the latest commit.
Thank you,
Ben
On 7 January 2013 09:38, Ben Major [email protected] wrote:
Thank you for brining this to my attention. I am going to look into it.
On 7 January 2013 08:48, miladiehexe [email protected] wrote:
After the update, a swiperight event is fired everytime I move the mouse
(on pc) no matter if klicked or not. And sometimes the swipe event seems to
be fired twice (maybe caused by problem 1)----- Ursprüngliche Nachricht -----
Von: Ben Major
Gesendet: 07.01.2013 01:02
An: benmajor/jQuery-Mobile-Events
Cc: miladiehexe
Betreff: Re: [jQuery-Mobile-Events] swipeleft/swiperight blocking page
scroll (#5)I have now pushed a new version of the code, which should now fix the
issues with scrolling andswipe
events. Instead of preventing the default
behaviour fortouchMove
, theswipe*
events are handled in the
touchMove
.This should fix the issue, and I have tested on iOS 4 and 5 (both on iPad
and iPhone), so I am closing this. In case you run into any further
problems, please start a new issue here based on the revised code.
Reply to this email directly or view it on GitHub:
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-11944346.
from jquery-touch-events.
Related Issues (20)
- Swipe Up/Down event.target is always the body element and not the element under the finder HOT 3
- not support jquery 3.3.1 HOT 9
- Event.data being lost when combining tap/tapstart/tapend HOT 5
- Pinch HOT 1
- How to enable the touch events on Surface Pro? HOT 13
- Delay between tap and alert()/confirm() HOT 3
- Bug (with fix): Bubbling (or fast) touch event can cause a single tap to always trigger a taphold due to hold_timer overwrite HOT 1
- TypeScript declaration file? HOT 1
- Not supporting jQuery 3.4.1 HOT 9
- Sliding range input right invokes swiperight HOT 14
- Angular 8 Support HOT 1
- Deprecated technique HOT 1
- Bug: Events can't be set on window or document
- Wrong swipe direction HOT 3
- Can't trigger long taps on Surface Pro HOT 8
- Webpack usage HOT 2
- Swipe event not working with touch screen in Microsoft Edge. HOT 4
- Not compatible with jQuery 3.6 HOT 3
- Setting the Threshold without the data-attribute HOT 1
- error thrown with missing firstTap 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 jquery-touch-events.