-webkit-overflow-scroll: touch;
).// Фиксация body
function bodyFixPosition() {
if (!document.body.hasAttribute('body-scroll-position-fixed')) {
var scrollPosition = window.pageYOffset || document.documentElement.scrollTop; // Получаем позицию прокрутки
document.body.setAttribute('body-scroll-position-fixed', 'true');
document.body.style.overflow = 'hidden';
document.body.style.position = 'fixed';
document.body.style.top = '-' + scrollPosition + 'px';
document.body.style.left = '0';
}
}
// Расфиксация body
function bodyUnfixPosition() {
var scrollCSSPosition = document.body.style.top.replace(/[^0-9.]/g, ''); // Получаем числовое значение позиции прокрутки из CSS
document.body.removeAttribute('body-scroll-position-fixed');
document.body.style.overflow = '';
document.body.style.position = '';
document.body.style.top = '';
document.body.style.left = '';
window.scroll(0, scrollCSSPosition);
}