Answer the question
In order to leave comments, you need to log in
How to fix the background of a Popup (modal window) on iOS?
For Android and Windows, the background is fixed, but for iOS it does not work.
Below is the code used.
CSS:
.scroll-hidden {
overflow: hidden;
}
<script>
$(document).ready(function(){
PopUpHide();
});
function PopUpShow(){
$("#popup1").show();
$("body").addClass("scroll-hidden");
}
function PopUpHide(){
$("#popup1").hide();
$("body").removeClass("scroll-hidden");
}
</script>
Answer the question
In order to leave comments, you need to log in
I can suggest using this solution: https://jsfiddle.net/FL3N/1gaxegxp/
To do this, use this library: https://github.com/FL3NKEY/fix-scroll
Also read the small documentation for this library, specifically the section "Preventing ", the problem and solution for iOS are described there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question