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

SpriteKit Collision Detection with Transparent image

ios canvas png sprite-kit collision-detection

I am trying to learn SpriteKit by going through a tutorial on making a Flappy Bird like Game. In my version of the game, the pipes are not pipes, and are irregularly shaped objects that don't fill...

Delay the application closing of windows phone

windows-phone-7 windows-phone-8 windows-phone

Is it possible to delay the application closing event in windows phone. What i trying to achieve is, i need to send a web request(for sending the usage time of application) for achieving analytics ...

modelformset_factory: display more fields for specific instances

django django-forms

I'm using a modelformset_factory to edit multiple instances of Product in the same form:

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.