I have something like this:
$div = $('<div id="error" title="Error">');
$div.append('<p>Hi</p>');
$div.dialog({
modal: true,
maxHeight:500,
});
Can i change background color of dialog title somehow like this?:
$div.dialog({
modal: true,
maxHeight:500,
}).find(".ui-dialog-titlebar").css("background-color","red");
Scroll down in the "Styles" tab until you find the attribute you care about ( background-color ). You can click on the value and type in a new value to verify that it will have the effect you desire. Your . css file needs to use the same style and be included after this one (see "short answer", above).
The jQuery UI dialog method is used to create a basic dialog window which is positioned into the viewport and protected from page content. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default. Syntax: You can use the dialog ()method in two forms: $(selector, context).
Use prev()
instead of find()
because that element is not inside $div
:
$div.dialog({
modal: true,
maxHeight:500,
}).prev(".ui-dialog-titlebar").css("background","red");
Also I use background
to override all other elements like background-image
Check this http://jsfiddle.net/Ad7nF/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With