透明的jQuery UI对话框

Omu*_*Omu 4 html css jquery jquery-ui

谁知道如何让ui对话框透明?

Sim*_*mon 9

创建一个类:

   .transparent_class {
        filter:alpha(opacity=50); /* for IE4 - IE7 */
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* IE8 */
        -moz-opacity:0.5;
        -khtml-opacity: 0.5;
        opacity: 0.5;
   }
Run Code Online (Sandbox Code Playgroud)

并将此类添加到UI元素.

阅读有关MS IE过滤器的更多信息.


Pra*_*ana 5

只需创建如下所示的样式,并在要具有透明背景的那些对话框上使用dialogClass选项.当然,你可以制作多种风格,并传递你想要的任何东西

<style type="text/css" media="screen">
    .transparent { background:transparent }
</style>

//make dialog with transparent background
$("#dialog").dialog({dialogClass:'transparent'});
//make default dialog
$("#dialog2").dialog();
Run Code Online (Sandbox Code Playgroud)

检查演示站点:jsBin(基本jquery,jquery ui,jquery ui css +自定义css透明类)