views:

9

answers:

0

Hello,

I'm trying to detect the scroll event in Android browser (my specific version is 2.1, but U want it to work also on older versions). This seems impossible!

I first tried this:

document.addEventListener('scroll', function(){ alert('test'); }, false);

But nothing is triggered (except when the page load).

I thought: well, let's be crazy and emulate it by : 1. Detecting touchend 2. Polling the window.pageYOffset so we know when the window stops scrolling 3. Manually trigger a user function I want on scroll.

Unfortunately, the touchend event doesn't look to be triggered either... in fact, when we don't scroll and only tap the screen (touchstart + touchend), it works. As soon as we scroll the page in between (touchstart + touchmove + touchend), it breaks everything.

Now my most basic example only contains this:

document.addEventListener('touchend', function(){ alert('test'); }, false);

But the alert doesn't show up when we scroll with the finger and release the touch...

Does anyone has a suggestion?

Thanks.