Solution of blank page when scroll bar scrolls to specified position on IOS system
- 2021-10-11 19:42:36
- OfStack
Reason:
-webkit-overflow-scrolling:touch
Explanation:
With the-webkit-overflow-scrolling attribute, the iPhone uses hardware acceleration, which makes the page slide more smoothly, but it also leads to blank pages.
Solution:
Before scrolling, set the attribute value of-webit-overflow-scrolling to auto, and then set it to touch when the page is scrolled.
Example:
$("#id").css('-webkit-overflow-scrolling','auto');
$("#id").scrollTop(9999);
$("#id").css('-webkit-overflow-scrolling','touch');