-
Notifications
You must be signed in to change notification settings - Fork 40
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
Mobile #21
Comments
hello there, I was wondering if this supports touch scrolling in iOS as well? |
I have tested this on Android 3.2, 4.0, an iPhone 4S and a Samsung Galaxy Tab 10.1 with Android 3.2. And it works on all. So it should support all touch devices. As long as they trigger the touchemove and touchstart events in Javascript. |
sweet! one more question, where does the first piece of code go? The second piece of code i got, but i wasn't exactly sure where to paste the first part |
You can put that before:
|
could you show us the example working? |
I got a live example over here: Just click through it and when you get to Fabrics on the left hand side you will get a scrollbar. Good luck! |
tsukasa1989, you are a lifesaver. Your code has mobile support plus it supports scrolling on mouse focus! This should be included in the code already. Thanks again! |
Hi tsukasa, I think there is actually a bug in the way the new position is calculated - this adjusts the position whenever the touchMove occurs, so that the touch position difference sets the velocity for the move, not the new position. For a quick example, try the following:
You can also try scrolling down and back up, it always scrolls in one direction. I ended up implementing following which I think should be correct: // Save the start position of handle
start : {
y : e.touches[0].pageY,
handleTop : this.handle.top
}, // Handle position based on displacement from touch start
var movement = e.touches[0].pageY - this.touch.start.y;
this.handle.top = this.touch.start.handleTop - movement*0.25; |
Thanks alot! is it working? |
Yes, it's working on the implementation I have. I also encountered some bugginess with clicks being registered after the scroll in iOS. I ended up implementing some code to intercept the mouse events, detect the drag distance to determine whether it should be considered a scroll gesture or not, and then re-triggering mouse events if it was not. I think there is probably a better solution out there though. |
Hi dailynathan. where should the bugfixes go should it be after this:
Thanks! |
Hello,
I needed some mobile scrolling and made the following code.
Functions to add:
Add the following code to the function appendEvents:
Good luck!
Tsukasa
The text was updated successfully, but these errors were encountered: