Giter Site home page Giter Site logo

Comments (10)

benmajor avatar benmajor commented on July 25, 2024

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.

benmajor avatar benmajor commented on July 25, 2024

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.

hotmeteor avatar hotmeteor commented on July 25, 2024

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...

  1. I will commit a pull request with my change (once I refresh myself on how to do it exactly).
  2. 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.

miladiehexe avatar miladiehexe commented on July 25, 2024

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.

benmajor avatar benmajor commented on July 25, 2024

Could you please put together a jsFiddle of your sample for me to have a look over?

from jquery-touch-events.

benmajor avatar benmajor commented on July 25, 2024

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.

benmajor avatar benmajor commented on July 25, 2024

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.

miladiehexe avatar miladiehexe commented on July 25, 2024

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.

benmajor avatar benmajor commented on July 25, 2024

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 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)


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-11944346.

from jquery-touch-events.

benmajor avatar benmajor commented on July 25, 2024

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 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)


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-11944346.

from jquery-touch-events.

Related Issues (20)

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.