![]() ![]() Return dY < 0 & container.scrollHeight - 16 <=Ĭontainer.scrollTop + container. up the screen, thus Y becomes smaller. Hint: trying to bounce over the bottom, the finger moves !on & setTimeout(() => (xopid = opid) & setTouchScroll(true), 250)Ĭonst dY = container.scrollTop - prevScrollTop as acceleration may not be off instantly. ![]() accelerated content makes short single over-bounce make over-bounce by dragging the finger. scroll position is settled, and there is no delta to Hint: auto-enabling after a small pause makes the start Let prevScrollTop = 0, prevTouchY, opid = 0Ĭ = on ? "touch" : null function preventScrollVerticalBounceEffect(container) )Ĭontainer.addEventListener("touchend", onTouchEnd)Ĭontainer.addEventListener("scroll", onScroll) This solution was tested on iOS 12.1.1 and has single drawback: while accelerating the scroll single over-bounce still happens as resetting the style may not cancel it immediately. Elastic scroll severely interferes with the performance of setTimeout (in Chrome, at least) - if you're doing WebAudio scheduling on-the-fly disabling elastic scroll can reduce the risk of drop-outs. This complex solution also tracks onscroll as bounce over the top makes scrollTop negative that may be tracked. ![]() The trick here is that this style is off, mobile Safari goes to ordinary scrolling and prevents over-bounce - alas, it is not able to cancel ongoing drag. Try this JS solution that toggles webkitOverflowScrolling style.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |