gpt4 book ai didi

javascript - Internet Explorer 不支持通过 jQuery 或 CSS 停止滚动

转载 作者:行者123 更新时间:2023-11-28 03:40:49 24 4
gpt4 key购买 nike

我正在制作一个重叠屏幕(如 facebook 照片查看器),目前它在 chrome、safari 和 firefox 中工作正常,但我也需要它在 IE 中工作。实际上,div 完全重叠,就像我想要的那样,但它允许它滚动,而我不想这样做。所以我尝试使用 overflow: hidden;单击按钮时,它不会滚动。它工作正常,但现在我的问题是让它再次滚动。我都尝试过 overflow: auto 和一些 jquery 函数,但它似乎不起作用。而且我还检测到它不会执行 jquery,例如 $(document).ready(function() { ... });

我用来重叠的代码:

var outercontent = document.getElementById('transparent')
var innercontent = document.getElementById('innercont')
browser = navigator.appName;
explore = "Microsoft Internet Explorer";
if(browser == explore) {
outercontent.style.zIndex = '9989';
outercontent.style.display = 'block';
outercontent.style.position = 'absolute';
outercontent.style.top = '0';
outercontent.style.left = '0';
outercontent.style.width = viewportwidth;
outercontent.style.height = viewportheight;
outercontent.style.margin = '0';
outercontent.style.padding = '0';

innercontent.style.left = '20%';
innercontent.style.background = 'white';
innercontent.style.zIndex = '9999';
innercontent.style.width = '60%';
innercontent.style.height = '80%';
innercontent.style.marginBottom = '10%';
innercontent.style.marginTop = '5%';
innercontent.style.padding = '10px';

}

在我的 html 页面中,我放置了 div:

<div id='transparent' style='background-color: rgba(0, 0, 0, 0.5);
filter:
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,
StartColorStr='#e5000000',EndColorStr='#e5000000');
text-align: center;'>
<div id='innercont' style='position: absolute; color: black;'></div>
</div>

最佳答案

如何将您的内容包装在 <div> 中?与 height: 100%; overflow: hidden; #innercont 内部?这应该更可控。

关于javascript - Internet Explorer 不支持通过 jQuery 或 CSS 停止滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11103475/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com