djett41 / ionic-scroll-sista

An Ionic plugin that hides the header/tabs while scrolling
MIT License
125 stars 38 forks source link

Scroll Sista doesn't work when JavaScript Scrolling is OFF. #24

Open desmochai opened 9 years ago

desmochai commented 9 years ago
screen shot 2015-10-12 at 7 14 30 pm
Narayon commented 8 years ago

@aqeelb, did you solve this? I think I found the solution, although I didn't test it on any physical devices yet: Just change this line var scrollTop = e.detail.scrollTop to this var scrollTop = e.detail ? e.detail.scrollTop : e.target.scrollTop, on the scroll event(:279)

desmochai commented 8 years ago

@Narayon :+1:

corentin-pasquier commented 8 years ago

Hi, I tried this solution and it's working, but the scrolling smoothness is very bad. Chrome gives me a warning in the console : Deferred long-running timer task(s) to improve scrolling smoothness. See crbug.com/574343.

Any idea why this this solution gives me a very slow application ? I'm working on an Android Tablet, Galaxy Tab S, 6.0.1).

Narayon commented 8 years ago

I'm guessing that's because the plugin is animating the top or bottom of the content, to compensate the translate of the header. Animate anything rather then transform and opacity will be a performance problem.
I end up adding css classes to the elements, making a one time animation, rather then partial animations on scroll. It's not perfect, but it reduces the jank and suits my needs.
You can try using the FLIP technique, by Paul Lewis. Share your solution if you give it a try.

soulmecca commented 8 years ago

Hi, I tried @Narayon 's solution but it only works while I'm touching device. I found that unlike web browsers, native devices can only detect scroll event while I'm touching it. So, when I scroll up to the header, the header shows up a few seconds later since it detects the scroll position when it stops. I am testing iOS devices. If you have any idea ! please help me out !