我试图阻止我的页面的主体滚动(完全),而模态覆盖是打开的。
该模式覆盖整个屏幕({position: fixed;top:0;left:0;right:0;bottom:0;}),并且有自己的滚动。然而,当我跑到我的模式窗口的滚动结束时,主窗口开始在它后面滚动。我试过所有我能想到的让身体停止滚动。这些东西都没有用:
CSS
body {
overflow: hidden;
pointer-events: none;
-webkit-overflow-scrolling: none;
}
#content { /* which contains all the non-modal content of the body */
-webkit-transform: scale(0);
position: relative; left: 100%;
}发布于 2013-12-16 20:09:06
看上去你很亲密。
当您的模式打开时,尝试以下CSS:
body{
overflow:visible;
max-height:100%; /* or 100px or something smaller than the screen if your viewport isn't set */
height:100% /* or 100px or something smaller than the screen */
}https://stackoverflow.com/questions/20619847
复制相似问题