michael
michael

Reputation: 3945

jQuery Dialog button change color inline

I'm using this code, and I want to change the color of each button inline, because i'm using custom classes for dialog, buttons etc. and I don't want to touch them.

$(function() {
  $colorDialog = $("#dialog").dialog({
    dialogClass: 'customDialogClass',
    autoOpen: false,
    buttons: [
      {
        TODO: change color
        click: function() {
          $(this).dialog("close");
          processResult("color");
        }
      }
    ]
  });
});

Upvotes: 0

Views: 385

Answers (1)

Tobias Golbs
Tobias Golbs

Reputation: 4616

You can change the css via jquery too.

click: function() {
    $(this).css('background-color', '#FF0000');
    $(this).dialog("close");
    processResult("color");
}

(I am assuming, that you want to change the color of the button that was clicked.)

Upvotes: 1

Related Questions