Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery模式表单的Css背景褪色问题_Jquery_Html_Css - Fatal编程技术网

jQuery模式表单的Css背景褪色问题

jQuery模式表单的Css背景褪色问题,jquery,html,css,Jquery,Html,Css,比提供粘贴的html/css更好我认为链接会更好: 基本上,我试图显示一个模态形式弹出点击“主题”在导航 但是,背景仅在navbar div中覆盖的区域变为粉红色,而不是整个页面 我以前从未遇到过这种情况,是因为导航栏上的相对位置吗 有这样一个隐藏的div #VbackgroundPopup{ display:none; position:fixed; _position:absolute; /* hack for internet explorer 6*/ h

比提供粘贴的html/css更好我认为链接会更好:

基本上,我试图显示一个模态形式弹出点击“主题”在导航

但是,背景仅在navbar div中覆盖的区域变为粉红色,而不是整个页面

我以前从未遇到过这种情况,是因为导航栏上的相对位置吗

有这样一个隐藏的div

#VbackgroundPopup{
    display:none;
    position:fixed;
    _position:absolute; /* hack for internet explorer 6*/
    height:100%;
    width:100%;
    top:0;
    left:0;
    background:#000000;
    border:1px solid #cecece;
    z-index:3;
}
然后点击按钮设置背景,如下所示

var docHeight = Math.max(

    $(document).height(),

    $(window).height(),

    /* For opera: */

    document.documentElement.clientHeight

);

var docWidth = Math.max(

    $(document).width(),

    $(window).width(),

    /* For opera: */

    document.documentElement.clientWidth

);

$("#VbackgroundPopup").css({

    "height": docHeight,

    "width": docWidth - 20

});


$("#VbackgroundPopup").css({

    "background-color": "#000000",

    "filter": "alpha (opacity=70)",

    "filter": "progid:DXImageTransform.Microsoft.Alpha(style=0, opacity=70)",

    "-moz-opacity": "0.7",

    "opacity": "0.7",

    "-khtml-opacity": ".7",

    "zoom": "1"

});

$("#VbackgroundPopup").css({
    "opacity": "0.6"
});

$("#VbackgroundPopup").show();

这应该考虑到所有浏览器…

粉红色的
#navbar
的子项,
#navbar
具有
溢出:隐藏
。结果是它被剪掉了。您的粉色
需要位于
#navbar
之外,或者您需要允许溢出(如果您使用
溢出:隐藏;
作为清除修复,则可能会显式清除浮动)。

我给出了代码示例,您可能可以更改代码以满足您的需求。谢谢您的回答,但问题不是无法显示模式表单,而是导航栏css/htmlI,我是个白痴。我只是在工作时点击了那个链接,甚至没有看网址。祝你的问题顺利。其他人可以回答。对不起,这里是上午12点,但是其他人看到这个链接时,除了化装服之外,没有任何x级的东西-警察服装,万圣节服装等。请看你的建议是否得到了实施,我希望整个页面都是粉红色的,这是溢出删除的:差不多了。您可以将粉色div向上移动到DOM中,使其成为
或某些或顶级元素(即左上角为0,0的元素)的直接子元素,然后调整定位,或者您可以保持层次结构不变,并使用
position
top
,并在CSS中左
,将粉红色div放在所需的位置。@Mu很短-非常好,现在可以工作了。然而,html/css本身是否有问题,因为“主题”上的简单下拉菜单也不起作用(css/html是由外部人员完成的)-