Any position parameters while scrolling webkit-overflow: touch event

I have a div with a webkit-overflow scroll set that I can touch. On iOS, this gives me an updated position during the touchmove event, but after the user releases this event and the last touchhend call completes, before all the events stop, but the div continues to scroll through the pulse.

This is the behavior that I want, but I also want to refresh the page during this impulse scroll.

I call the requestAnimationFrame call when the touchhend event occurs, and I can loop this while the impulse scrolls. But when I get the DOM information, it freezes until the mometnum scroll disappears.

I tried using the scroll position of the scroll element and elementFromPoint, but both of them have only the position that the div scrolled when the touchhend was running, and do not refresh until the momentum scroll ends.

Does anyone know how to get real-time DOM information on iOS (6+ without worrying about 5)

Here is the code I'm using:

var glideStart; var bird_scanner = document.getElementById('bird-scanner'); bird_scanner.addEventListener('touchend',function() { glideStart = null; requestAnimationFrame(glide); }); function glide(timestamp) { // if we need to reset the timestamp if( glideStart === null ) { glideStart = timestamp; } // determine if we've moved var bird_scanner = document.getElementById('bird-scanner'); console.log( document.elementFromPoint(337,568) ); // calculate progress (keep running for a very long time so we see what happens when momentum ends) var progress = timestamp - glideStart; if( progress < 10000 ) { requestAnimationFrame(App.Controller.bird.glide); } } 

Update

After many attempts on this, I think that it is really impossible without using any library to try to simulate the impulse scrolling instead of using the built-in option (something that I find really does not give, because the results are smooth). Apple is clearly very concerned that it interferes with their pulsed scroll animation and prevents it from displaying properly.

I ended up deleting the scroll by pulses and just discovered the scroll and immediately went through a bunch of elements when triggered.

I noticed a particularly strange behavior. When I had a webkit-overflow scroll: click on the element that scrolled the page up / down and added setTimeout (some_func, 0) to the touchhend event, the function did not start until the momentum scroll ended. When I tried the same thing on a scroll going left / right, he immediately turned on the function. Do not tell me why this is happening, I decided that it was just some strange draw of a webkit.

+7
javascript dom javascript-events ios dom-events touch
source share

No one has answered this question yet.

See related questions:

230
How to add touch event to UIView?
204
Pass mouse events through an element with absolutely positioning
27
Current scroll position when using -webkit-overflow-scroll: touch - javascript event for Safari iOS (scrollTop / scrollLeft)
2
Stop scrolling pulse ontouchstart ngTouch AngularJS
one
What event to listen to while scrolling inertia / momentum on Cordoba iOS w / React
one
-webkit-overflow-scrolling: touch, large content is disabled when specifying the width
0
Cordova iOS scrolls like a mess when -webkit-overflow-scrolling: touch and auto change
0
iOS scrolling by scrollable div with fixed positioned child
0
Keep the item fixed when using -webkit-overflow-scrolling: touch
0
overflow scroll: touch scroll position for ios cordov

All Articles