我想在 Web 应用程序中禁用 iOS 过度滚动,但仍允许滚动正文。
$(document).on('touchmove', function(e) {
e.preventDefault();
});
完全禁用滚动(正如人们所期望的那样)。
有没有办法做我想做的事?
最佳答案
我几乎有 same issue .这应该可以帮助您:
// Disable overscroll / viewport moving on everything but scrollable divs
$('body').on('touchmove', function (e) {
if (!$('.scrollable').has($(e.target)).length) e.preventDefault();
});
关于javascript - 禁用 iOS Overscroll 但允许正文滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10546857/