Javascript与衰落区
当我的模态窗口打开时,我试图使“黑暗”区域变暗。下面是我写的:第一个函数f_documentSize将返回窗口的大小,第二个函数将使fullwindowdiv。 它工作得很好,但是有滚动条(垂直和水平)。当我滚动它们时,页面会变大(可用空间)。为什么? 尝试将“模式背景”DIV的显示样式设置为Javascript与衰落区,javascript,Javascript,当我的模态窗口打开时,我试图使“黑暗”区域变暗。下面是我写的:第一个函数f_documentSize将返回窗口的大小,第二个函数将使fullwindowdiv。 它工作得很好,但是有滚动条(垂直和水平)。当我滚动它们时,页面会变大(可用空间)。为什么? 尝试将“模式背景”DIV的显示样式设置为位置:绝对,并将其左侧,顶部,右侧,以及底部属性设置为0。还要确保其边距为0 #modalDiv { position:absolute; background-color: #CCCCCC;
位置:绝对
,并将其左侧
,顶部
,右侧
,以及底部
属性设置为0。还要确保其边距为0
#modalDiv {
position:absolute;
background-color: #CCCCCC;
-moz-opacity: 0.5;
opacity: 0.5;
filter:alpha(opacity=50);
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: 0;
z-index: 9999 /* where 10K is the dialog and 9999 > everything else */
}
谢谢我将位置设置为绝对并配置了z索引。
#modalDiv {
position:absolute;
background-color: #CCCCCC;
-moz-opacity: 0.5;
opacity: 0.5;
filter:alpha(opacity=50);
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: 0;
z-index: 9999 /* where 10K is the dialog and 9999 > everything else */
}