开发者

How do I over write the styles on a jQuery dialog

开发者 https://www.devze.com 2023-01-11 18:48 出处:网络
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 cha

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: f开发者_运维知识库alse,
                        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');
0

精彩评论

暂无评论...
验证码 换一张
取 消