Answer the question
In order to leave comments, you need to log in
overflow:hidden not working on body and html on iPhone?
There is an event for opening a modal window. when opening a window, html and body should be blocked from scrolling (we use overflow:hidden), but it does not work on the iPhone and the standard xiaomi browser (maybe it does not work somewhere else, did not check). on regular android browsers works exactly
Exemplary spawn codeoverflow:hidden;
$('.product_btn, .social_callback').click(function () {
$('html, body').css('overflow', 'hidden');
});
height:100%;
height: 100%;
Answer the question
In order to leave comments, you need to log in
Tx guys. I found a solution, when opening a modal window, the following action is performed:
$('.product_btn, .social_callback').click(function () {
var scrollX = window.scrollX;
var scrollY = window.scrollY;
window.onscroll = function () { window.scrollTo(scrollX, scrollY); };
});
$('.popup_close, .modal_close').click(function () {
window.onscroll = function () { return; };
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question