Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery dialog theme and style

How do I change the background color of the title bar of a jQuery dialog?

I have looked at the themeroller but it does not seem to work for me.

Thanks

like image 966
Picflight Avatar asked Mar 31 '09 18:03

Picflight


People also ask

What is dialog in jQuery?

A dialog box is a floating window with a title and content area. This window can be moved, resized, and of course, closed using "X" icon by default. jQueryUI provides dialog() method that transforms the HTML code written on the page into HTML code to display a dialog box.

What is jQuery UI themes?

jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.

What is a jQuery modal window?

JQuery Modal is an overlay dialog box or in other words, a popup window that is made to display on the top or 'overlayed' on the current page. It is a pop up modal box that is converted into the viewport deliberately for the user to interact with before he can return to the actual site.


3 Answers

You can change it by modifying the ui-dialog-titlebar CSS class, but I highly recommend you to use the ThemeRoller tool.

See also:

  • UI/Dialog/Theming
  • UI/Theming/API
like image 74
Christian C. Salvadó Avatar answered Oct 29 '22 15:10

Christian C. Salvadó


I do this way (adding "ui-state-error" style for header):

<script type="text/javascript">
            $(function () {
                $("#msg").dialog({
                    open: function () {
                        $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
                    }

                });

            });
        </script>  
like image 36
DonSleza4e Avatar answered Oct 29 '22 17:10

DonSleza4e


There are classes associated with each element in the dialog.

Use Firebug to inspect the elements and use CSS to style them. For example, the title bar has the class "ui-dialog-titlebar".

(this assumes that you are using the jQuery UI Dialog)

like image 34
jonstjohn Avatar answered Oct 29 '22 15:10

jonstjohn