在模式对话框中淡入叠加 [英] Fade in overlay in modal dialog
本文介绍了在模式对话框中淡入叠加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个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屋!
查看全文