You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is quite problematic that it isn't possible to choose whether the default swipe action should be prevented or not. What if I want to listen to the swipedown event on the document element to hide the mobile navigation when the user scrolls down? What about parallax scrolling for touch devices, where the scroll/swipe event is used to check the current scrolltop and load or modify content based on the page offset? At the moment all this is not possible, as the plugin prevents regular scrolling completely. The touchWipe plugin, which this one claims to be based upon, considered this and offers the preventDefaultEvents parameter. It would be really great if this plugin would not prevent everything by default, but would leave it to each actual event Listener to stop the event from bubbling up further or not, using proper jQuery syntax like this:
Thanks for the feedback.
I've added a config option. I'm afraid it's an all or nothing thing though, as there's no way to know in advance where the swipe is going.
So, if you don't want to always prevent the default move action, you can use the config option. Note that to prevent it manually, you have to write $(document).on('touchmove',... (not swipedown).
I think it is quite problematic that it isn't possible to choose whether the default swipe action should be prevented or not. What if I want to listen to the swipedown event on the document element to hide the mobile navigation when the user scrolls down? What about parallax scrolling for touch devices, where the scroll/swipe event is used to check the current scrolltop and load or modify content based on the page offset? At the moment all this is not possible, as the plugin prevents regular scrolling completely. The touchWipe plugin, which this one claims to be based upon, considered this and offers the preventDefaultEvents parameter. It would be really great if this plugin would not prevent everything by default, but would leave it to each actual event Listener to stop the event from bubbling up further or not, using proper jQuery syntax like this:
This would just feel natural to any jQuery developer and opens up lots of possibilities where there were serious limitations before.
Best regards,
Stefan
The text was updated successfully, but these errors were encountered: