user3495160
user3495160

Reputation: 185

Dialog Close button color change

i want to have color in my close button, but that is not working to me.

Below is my code for dialog box JSfiddle

function fnOpenNormalDialog() {

    // Define the Dialog and its properties.
    $("#dialog-confirm").dialog({
        resizable: false,
        modal: true,
       //title: "Modal",
        height: 200,
        width: 300,
        create: function (e, ui) {
            var pane = $(this).dialog("widget").find(".ui-dialog-buttonpane")
            $("<label class='remember_me' ><input type='checkbox' id='remember'/ > Do Not Show this again</label>").prependTo(pane)
        },

        open: function(event, ui) {
  $(this).closest('.ui-dialog').find('.ui-dialog-titlebar').hide();
},
        buttons: {          
            "Close": function() {
            $(this).dialog("close");
        },
      class:"ui-button-spl1"
        }
    });
}

and here my CSS for the button , pls help me how to add this class to get color

   #dialog-confirm {
   display:none
  }
    .ui-dialog-buttonset .ui-button-spl1{
    background:green;
  }

Upvotes: 1

Views: 4581

Answers (1)

Pesulap
Pesulap

Reputation: 894

Change your css to :

#dialog-confirm {
   display:none
  }
  .ui-dialog-buttonset .ui-button{
    background:green;
  }

and the button will be green. There you have an unused class "spl1" in css


OR

you can addClass to button:

open: function(event, ui) {
    $(this).closest('.ui-dialog').find('.ui-dialog-titlebar').hide();
    $(this).closest('.ui-dialog').find("button").addClass("ui-button-spl1");
},

Upvotes: 1

Related Questions