简体   繁体   English

溢出不适用于iPhone和iPad

[英]Overflow not working on iPhone and iPad

I'm using this javascript part to hide or no scrollbar when my modal is open or no, but iPhone and iPad don't hide my scroll anyway ? 当我的模式打开或不打开时,我正在使用此javascript部分隐藏或不显示滚动条,但是iPhone和iPad仍然不隐藏我的滚动条吗? The problem comes from position relative ? 问题来自相对位置?

here is my javascript code 这是我的JavaScript代码

function openNav()  {
document.getElementById("myNav").style.cssText = "height:100%";
document.body.style.overflow = "hidden";
}
function closeNav() {
document.getElementById("myNav").style.cssText = "height:0%";
document.body.style.overflow = "scroll";
}

to resolve my problem for the modal I need to add 解决我的模态问题,我需要添加

-webkit-overflow-scrolling:touch

in my CSS file here 在我的CSS文件中

*, *:after, *:before {

But the problem still exist when i try to open my fullscreen menu !! 但是当我尝试打开全屏菜单时,问题仍然存在!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM