The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Horizontal drag scrolling Reply To: Horizontal drag scrolling


Glad that ended up getting solved, I doubted it a bit because what you described didn’t exactly match what I came across. But having it working on Android 2.3, I couldn’t think of anything that would be different on iOS. It’ll be interesting to know what is happening with Codepen though.

When it comes to vertical scrolling, I think the best thing would be to keep the default behaviour enabled. If it’s not interfering with the draggable somehow of course (but I don’t think it will). You could remove this line and try it out :

e.preventDefault(); <---
.find('a').on(press, function() {

If that’s creating some new issue, a next step could be to implement another bit of script that’ll turn a vertical touchmove into a scrollTop().

The only ‘conflict’ on resize I can think of is when you’re in portrait mode and fully dragged to the left and then change rotation. The element will have more offset that way than it’s supposed to. But it shouldn’t be too difficult to add a tweak for that (I’ll have a look)…

Good practice. B-D