-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
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? |
@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. |
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. |
@bradbirdsall this is a pretty good suggestion to add a couple of stopPropagations… I can't think of any side effect. |
Sounds like a pretty good idea. Can anyone think of any side effects? If not throw up some pull requests :) |
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
The text was updated successfully, but these errors were encountered: