CSS:自定义Jquery警报 - 透明背景

时间:2012-07-30 07:02:12

标签: css

我目前正在处理来自此SITE的自定义jquery警报。当警报出现但未成功时,我试图获得灰色透明背景。如何获得覆盖警报框背后整个背景的灰色透明屏幕?这是我的EXAMPLE

CSS

<style>
#popup_container {
    font-family: Arial, sans-serif;
    font-size: 12px;
    min-width: 300px; /* Dialog will be no smaller than this */
    max-width: 600px; /* Dialog will wrap after this width */
    background: #FFF;
    border: solid 5px #999;
    color: #000;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

#popup_title {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 1.75em;
    color: #666;
    background: #CCC url(images/title.gif) top repeat-x;
    border: solid 1px #FFF;
    border-bottom: solid 1px #999;
    cursor: default;
    padding: 0em;
    margin: 0em;
}

#popup_content {
    background: 16px 16px no-repeat url(images/info.gif);
    padding: 1em 1.75em;
    margin: 0em;
}

#popup_content.alert {
    background-image: url(images/info.gif);
}

#popup_content.confirm {
    background-image: url(images/important.gif);
}

#popup_content.prompt {
    background-image: url(images/help.gif);
}

#popup_message {
    padding-left: 48px;
}

#popup_panel {
    text-align: center;
    margin: 1em 0em 0em 1em;
}

#popup_prompt {
    margin: .5em 0em;
}
</style>

1 个答案:

答案 0 :(得分:1)

您需要this fiddle

中的内容

'alertblanket'具有较高的z-index并覆盖整个页面。然后,您的对话框必须具有更高的z-index才能位于'alertblanket'

之上

编辑:您只需设置

即可设置该警报库的颜色
$.alerts.overlayiOpacity = 0.5
$.alerts.overlayColor = '#AAA'

或者你喜欢什么。另请参阅jquery.alerts.js的.js文件中的注释