4 ms·
You could solve a lot of problems with position: absolute and javascript, which you assume is on. A bigger problem is that mobile safari doesn't let you execut
by EGreg 13y ago
You could solve a lot of problems with position: absolute and javascript, which you assume is on.
A bigger problem is that mobile safari doesn't let you execute js during scroll. One way around that is by hsing iScroll which fakes scrolling using CSS.
- Encosia 13y agoYou can use the touchmove event to do things while mobile safari scrolls.
- EGreg 13y agoReally? http://stackoverflow.com/questions/10482227/javascript-dom-changes-in-touchmove-delayed-until-scroll-ends-on-mobile-safari/10856671#10856671 http://stackoverflow.com/questions/10482227/javascript-dom-c...
- Encosia 13y agoLooking back at the code that I was thinking of, it looks like I was using requestAnimationFrame to do the actual DOM manipulation (based on a variable that was updated in touchmove). Maybe Mobile Safari still allows DOM manipulation during those animation frame callbacks, even if touchmove is happening?
- mikaraento 13y agoThat's right: a) you don't get scroll events until the scroll has finished, b) you do get touch events that drive the scroll (but nothing during the inertial part), c) the appearance of the page is not updated until the scroll has finished. You can get around this by using programmatic scrolling (e.g., iScroll, zynga-scroller) but you'll never get quite as nice scrolling as with the native behaviour.