Skip to content
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

jumpy behaviour on iPhone #4

Open
emwee opened this issue Jun 27, 2014 · 5 comments
Open

jumpy behaviour on iPhone #4

emwee opened this issue Jun 27, 2014 · 5 comments
Labels

Comments

@emwee
Copy link

emwee commented Jun 27, 2014

On my iPhone (4s), the scroll up bar behaves a little bit jumpy.

First off; when I scroll down fast (not even very fast), without any intervals, the top bar does not disappear. Only when I stop scrolling, the bar disappears, while I expect the top bar to hide as soon as I scroll down.

When I scroll down, and immediately up, the top bar sometimes appears but from the middle of the page, as if it were flying around the page.

@eduardomb eduardomb added the bug label Jun 27, 2014
@eduardomb
Copy link
Owner

I'm currently working on some improvements and I'll definitively give priority to this and implement proper touch support. Thanks for the detailed report.

@emwee
Copy link
Author

emwee commented Jun 27, 2014

Awesome, thanks!

From what I've understood from this discussion at StackOverflow (http://stackoverflow.com/questions/2863547/javascript-scroll-event-for-iphone-ipad) is that scroll events are handled different by iPhone. I tested more "scroll up menu's" and most of them behave like yours; i.e. while scrolling down, the menu does not disappear (as the 'scroll' event is not triggered until the user has finished "swiping").

In the meantime I will try and use Hammer.js to capture typical touch events like drag, swipe etc.

@eduardomb
Copy link
Owner

I couldn't find a way to simulate momentum scroll on iOS. I ended up adding a specific simplified fallback implementation for iOS. See ef6678a.

Now if you try the plugin on your iPhone or iPad it will behave a little different:

  • the bar's state (hidden or revealed) won't change during scroll;
  • only when the user stops scrolling the bar will hide / reveal depending on scroll direction;

@emwee
Copy link
Author

emwee commented Jul 1, 2014

In of the comments it is mentioned that

detecting the top of the viewport on the iphone/ipad only works with window.pageYOffset and not
document.body.scrollTop||document.documentElement.scrollTop like every other browser/hardware > in existence

so I have a feeling the problem lies in there. Will also try to look at this myself later this week!

@eduardomb
Copy link
Owner

The scrolling Y position seems to be working on iOS7. The problem is we need to manipulate DOM during scroll and according to jQuery Mobile iOS devices freeze DOM manipulation during scroll, queuing them to apply when the scroll finishes. So, even touchmove will be ineffective for updating the bar position during scroll.

I'm reopening the issue for further thoughts.

@eduardomb eduardomb reopened this Jul 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants