jQuery UI对话框叠加层-如何为不同的对话框设置不同的背景颜色 [英] jQuery UI dialog overlay - how to set different background colors for different dialogs

查看:82
本文介绍了jQuery UI对话框叠加层-如何为不同的对话框设置不同的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了不同的jQuery对话框.对于某些对话框,我需要透明的背景. 如果我更改.ui-widget-overlay类中的background CSS,则它将应用于所有对话框.

I have used different jQuery dialogs. For some dialogs I want a transparent background. If I change the background CSS in the .ui-widget-overlay class then it will apply to all the dialogs.

如何为不同的对话框设置不同的背景颜色?

How to set different background colors for different dialogs?

推荐答案

只需创建以下样式,然后在要具有透明背景的对话框上使用dialogClass选项.当然,您可以制作多种样式,并根据需要传递

Just create a style like the following and use the dialogClass option on those dialogs you want to have a transparent background. Of course you can make multiple styles and pass in whatever you want

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

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

检查演示站点: http://jsbin.com/ifoja (基本jquery,jquery ui,jquery ui css +自定义css透明类)

Check demo site: http://jsbin.com/ifoja (basic jquery, jquery ui, jquery ui css + custom css transparent class)

这篇关于jQuery UI对话框叠加层-如何为不同的对话框设置不同的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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