1

I am using the jquery ui dialog. I have looked at How to change the jquery ui dialog button color? but it looks they this user is taking a different approach.

I am using the dialog buttons option.

Here is my javascript:

$(document).ready(function(){
    $("#credentialsDialog").dialog({
        autoOpen: false,
        buttons: {
            Submit: function() {
              $( this ).dialog( "close" );
            }
        },
        dialogClass: 'ui-dialog-titlebar'
    });
    $( "#opener" ).click(function() {
        $("#credentialsDialog").dialog('open');
    });
});

Here is the CSS it is referring to:

.ui-dialog-titlebar {
  background-color: #f6f6ff;
  background-image: none;
  color: #f6f6ff;
}

I have also tried this found here:

buttons: {
            Submit: function() {
              $( this ).dialog( "close" );
            },
            'class': 'ui-dialog-titlebar'
        }

But this is not working either.

What is the correct way to change the background color of the button area?

Here is my dialog so far:

1 Answer 1

0

If you want to style the buttons, target them with:

.ui-dialog .ui-dialog-buttonpane button.ui-button {
/* your rules here */
}
Sign up to request clarification or add additional context in comments.

2 Comments

so the .ui-dialog-buttonpane will change the background color, correct?
.ui-dialog-buttonpane is the class attached to the div that the buttons reside in. You want to use that class to make sure your rules are more specific than the default CSS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.