在模态对话框中淡入叠加 [英] Fade in overlay in modal dialog

查看:25
本文介绍了在模态对话框中淡入叠加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 JQuery UI 对话框,它是模态的,具有 50% 不透明度的黑色背景.是否可以使背景不透明度从 0% 衰减到 50%?如果是这样,怎么做?因为目前在显示对话时感觉有点像直接打脸.

I have a JQuery UI dialog which is modal and has a black background with 50% opacity. Is it possible to make the background opacity fade from 0% to 50%? If so, how? Because currently it feels kind of like getting a punch straight to the face when a dialog is shown.

FWIW,这是我目前使用的 CSS:

FWIW, this is the CSS I'm using at the moment:

.ui-widget-overlay {
    background: black;
    opacity: 0.5;
    filter: alpha(opacity = 50);
    position: absolute;
    top: 0;
    left: 0;
 }

推荐答案

您可以使用jQuery fadeTo() 函数.更多信息可以在下面的链接中找到.http://docs.jquery.com/Effects/fadeTo#speedopacitycallback

You can use the jQuery fadeTo() function. More information can be found on the link below. http://docs.jquery.com/Effects/fadeTo#speedopacitycallback

这篇关于在模态对话框中淡入叠加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆