-
Notifications
You must be signed in to change notification settings - Fork 209
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
vertical scrolling on the iPhone #7
Comments
This actually is a very interesting point and valid I didn't realize back then. Thank you for bringing it up! I will think about some wise solution for that. Especially with respect to multi-row setup support which is a new feature in 1.1 and which employs vertical scrolling. For other cases I guess the vertical scrolling could be released back to the underlaying page. It definitely won't be in the upcoming 1.1, which is in RC now, but some patch should be available soon after. Also besides the fact I realize what the problem is already, can you show me your testcase. It would be very helpful. Thanks! |
here is a test case: http://dev.briankuzma.com/jqTouchTest/ Thanks a lot, looking forward to the wise solution :) |
I actually just implemented a fix for this myself if anyone is interested. The trick is analyzing the path someone's finger travels and then determining if they are trying to swipe the image or actually scroll the page. This is quick and dirty proof of concept code and could be re factored more properly as a patch to use the existing code structure. Please feel free to refactor and incorporate back into the plugin. We're using this plugin for a major auto manufacturer's mobile site and really dig it. Keep up the great work.
//The code below should be added after line 248 var origin_x; var origin_y; //The code below can replace the code from lines 270 - 271 .bind(_touchstart_, function(e){ //Store the point where our touch began origin_x = finger(e).clientX; origin_y = finger(e).clientY; t.trigger('down', [finger(e).clientX, finger(e).clientY, true]); return true; }) .bind(_touchmove_, function(e){ //Determine the angle that the touch event is moving along var x_travel = abs(origin_x - finger(e).clientX); var y_travel = abs(origin_y - finger(e).clientY); var touch_angle = (Math.atan(x_travel / y_travel) * 180)/3.14; //Anything above 45 is usually an attempted swipe on the reel image if(touch_angle>45) { t.trigger('slide', [finger(e).clientX, finger(e).clientY, true]); return false; } else { return true; } }) |
Nice one, Matt! Your approach indeed looks right. Thanks for sharing. I will look into it deeper this weekend. I'm looking forward to the site you're working on ;) .pisi |
Will do. I'll be sure to float you a link when it launches. |
Matt, I implemented your solution. I liked it and even improved it - the touch origin is being already tracked by Reel's But my progress got a little twist ;) Soon I realized that when So after all the solution lied in adding a general purpose reeling indicator property and letting Safari do its job in detecting the scroll ;) Anyway, I just released the patch version 1.1.1 with the cure. PS: Please let me know if posting of your (credited) links on Reel site is possible (from one my other mail). Thanks. |
Hi, I have a Reel instance that I'm using in an iPhone-specific site. The image is 320x240 px, which occupies a fair amount of screen space. I'm unable to swipe vertically on the image to scroll the page up and down.
The text was updated successfully, but these errors were encountered: