Seeking a way to detect the scroll event in the Android browser (I am using version 2.1, but I need it to function on older versions as well). It feels like an impossible task!
Initially, I attempted:
document.addEventListener('scroll', function(){ alert('test'); }, false);
However, nothing happens except when the page is loading.
I then decided to get creative and emulate the scroll event by: 1. Detecting touchend 2. Monitoring window.pageYOffset to determine when scrolling stops 3. Manually initiating the desired function on scroll.
Unfortunately, the touchend event doesn't seem to trigger either... in fact, it only works if we tap the screen without scrolling (touchstart + touchend). Once we scroll between taps (touchstart + touchmove + touchend), everything breaks.
At this point, my simplest example consists of:
document.addEventListener('touchend', function(){ alert('test'); }, false);
Yet, the alert does not display when we scroll with our finger and release the touch...
If anyone has any suggestions, they would be greatly appreciated.
Thank you.