unique model background color for dialog jQuery UI

How do I change the model background color for

$dialog1 modal background to red 

$dialog2 modal background to blue

I do not want a global solution I need to change each to be unique.

Thanks for the help

http://jsfiddle.net/wMmmX/

    var $dialog1 = $('<div />');
    $dialog1.dialog({
        width: 100,
        height: 100,
        modal: true,
        resizable: false,
        position: [0, 0] ,
        open: function () {
            //$('.ui-widget-overlay').css({ 'background': 'red' });
            $(this).css({ 'background': 'red' }); // not changing modal back ground
        }
    });

    var $dialog2 = $('<div />');
    $dialog2.dialog({
        width: 100,
        height: 100,
        modal: true,
        resizable: false,
        position: [200, 200],
        open: function () {
            //$('.ui-widget-overlay').css({ 'background': 'blue' });
            $(this).css({ 'background': 'blue' }); // not changing modal back ground
        }

    });

Answers


try this one :

var $dialog1 = $('<div />');
$dialog1.dialog({
    width: 100,
    height: 100,
    modal: true,
    resizable: false,
    position: [0, 0] ,
    open: function () {
        $(this).dialog('widget').next('.ui-widget-overlay').css({ 'background': 'red' }); // not changing modal back ground
    }
});

Need Your Help

Best deploy method for registry and certificates

deployment installer registry certificate

I need to deploy some registry keys and install certificates in some stores on each of my clients computer.

iOS - How can I use a common view to draw different views depending on a property?

iphone ios ipad uiview subclass

I have 2 views named 'AA' and 'AB' (and in a near future I'll have more: 'AC', 'AD', etc...).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.