Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchy takes over events (or so I think) #12

Closed
Drvanon opened this issue Jun 28, 2013 · 1 comment
Closed

Touchy takes over events (or so I think) #12

Drvanon opened this issue Jun 28, 2013 · 1 comment

Comments

@Drvanon
Copy link

Drvanon commented Jun 28, 2013

When I use touchy-pinch, I can't use jquery's (or phonegap's) touch-start event.

@fisherwebdev
Copy link
Member

To answer your question effectively, I probably need to see how you are using Touchy. Can you post some code?

Or try this, but without more context I'm not sure if it will work for you:

$('#my_div').data('touchyPinch').settings.preventDefault.start = false;

The default of the above configuration setting is true, which pretty much stops touchstart in its tracks. However, if you change this setting to false, you will now see the mousedown and click events fire, which you might not want. Preventing these events from firing is the reason why Touchy calls event.preventDefault().

Also note that Touchy is based on its own event delegation scheme, and this can be limiting if you are trying to set up an event delegation of your own. You can try overriding that setting, but it is computationally expensive and may not work exactly as you expect. For more discussion of that issue, see issues #4 and #5.

$.touchyOptions.useDelegation = true;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants