Krasimir
Krasimir

Reputation: 259

JQuery Dialog Button Css

i have code like this:

 $("#confirm").dialog({
                modal: true,
                title: 'Confirm',
                resizable: false,
                draggable: false,
                autoOpen: false,
                height: 200,
                width: 550,
                buttons: [{
                    tabIndex: -1,

                    text: 'Yes',
                    "class": 'informationLearnButton',           
                    click: function () {
                       ...
                        }
                        else {

                        }
                        $(this).dialog("close");
                    }
                },
                    {

                        tabIndex: -1,
                        text: 'No',
                        'className': 'SomeOtherCssClass',
                    click: function () {
                        $(this).dialog("close");
                    }
                }]
            });

class doesn't work for me i tried with class ,className with "" and without "" . JQuery version is 1.8.22. What to do now

Upvotes: 1

Views: 4527

Answers (1)

coder
coder

Reputation: 13250

Here is a sample for you how to use class:

DEMO

$("#dialog").dialog({
    buttons: {
        'Confirm': function() {
            //do something
            $(this).dialog('close');
        },
        'Cancel': function() {
            $(this).dialog('close');
        }
    },
    create:function () {
        $(this).closest(".ui-dialog").find(".ui-button:first").addClass("custom");
    }
});

Upvotes: 2

Related Questions