I'm trying to create a mobile message feed that scrolls smoothly on mobile using touch. I've found that divs scroll really nicely on mobile when the css height is set to 100%. I need to capture the scroll event to know when the user has scrolled to the bottom to be able to fetch the next batch of messages and add them to the list. But unfortunately the scroll event doesn't fire when the height of the div is set to 100%. And when I remove the height: 100%
from the div css, the scrolling is slow and jerky on my Android.
Does anyone know either;
- a) how to make divs scroll really smoothly on mobile without
height: 100%
, - b) get the scroll event to fire on the page when the
height: 100%
is set, or - c) other events that I could use to know when the user has scrolled to near the bottom of the page?
I've tried -webkit-overflow-scrolling: touch
, position: absolute
and min-height: 100%
from other answers and suggestions I've seen but these don't seem to make any difference.
many thanks in advance