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

nested swiper #41

Closed
DaFrik opened this issue Mar 1, 2012 · 5 comments
Closed

nested swiper #41

DaFrik opened this issue Mar 1, 2012 · 5 comments

Comments

@DaFrik
Copy link

DaFrik commented Mar 1, 2012

Hi Brad,

Thanks for creating this wonderful swipe. It is the most straightforward one after I tried with other similar library and with great documentation!

In my application I need to nested swiper inside swiper, and the current swipejs code didn't support that, so I hacked into your core and added

" e.stopPropagation();" in within both onTouchStart (line177) and onTouchMove (line 201) , and it works like a charm. See if you want to include that in your next version so that nested swiper is possible out of the box.

Cheers,

DaFrik

@alexblack
Copy link

I'm not sure if this is related, but I'm interested in having a slider (e.g. for the user to choose a price) in a swipe div. I'm trying out using this one: http://code.ovidiu.ch/dragdealer/

It actually works, but both the slider and the swipe move when I touch-drag :)

I'm wondering if you have any suggestions what approach I need to take here. I think the slider needs to receive the events and prevent the swipe from receiving them?

@DaFrik
Copy link
Author

DaFrik commented Mar 14, 2012

@alexblack , i believe you have to dig into the dragdealer's code and add the stopPropagation() function to appropriate event to prevent the touch event reach the swipejs when you are indeed dragging the slider.

@alexblack
Copy link

Thanks DaFrik, thats what I was thinking too.. but I wasn't sure which component would be receiving the events first, Swipe.js or DragDealer..?

At first glance it looks like DragDealer already calls stopPropagation, I'll have to look at it more closely.

@benschwarz
Copy link
Contributor

@bradbirdsall this is a pretty good suggestion to add a couple of stopPropagations… I can't think of any side effect.
What do you think about making this change (in both branches?)

@thebird
Copy link
Owner

thebird commented Jun 14, 2012

Sounds like a pretty good idea. Can anyone think of any side effects?

If not throw up some pull requests :)

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

4 participants