问题描述:

I want to create a jQuery dialogue and overwrite the color setting for this one instance, not any others - now creating the dialog is easy but setting it's styles is providing difficult, how do I change the title and overlay colours? I'd like to add them dynamically here, something like background:"red", as I don't want to change any css files I don't mind dynamically updating the CSS values via jQuery for this one modal.

Here's my code

(document).ready(function() {

var $dialog = $('<div id="dynamicDiv"></div>')

.html('Loading... <img src="../ajax-loader2.gif" alt="Loading" />')

.dialog({

bgiframe: false,

autoOpen: false,

draggable: false,

modal: true,

resizable: false,

show: 'slide',

height: 60,

closeOnEscape: false,

title: '',

});

$dialog.dialog('open');

网友答案:

Like this:

$dialog.closest('.ui-dialog').css('background', 'red');
相关阅读:
Top