I want change the default close icon button in jquery Dialog.
I tried to add this css class in jquery-ui-1.8.23.custom.css:
.ui-icon-myCloseButton { background-image: url(/path/image.png); }
and in the Dialog Definitions:
$('#documentsDialog').dialog({
create: function(event,ui) {
var widget = $(this).dialog("widget");
$(".ui-dialog-titlebar-close span",widget).removeClass("ui-icon-closethick").addClass(".ui-icon-myCloseButton");
});
but no luck, any idea?
You were just missing a closing curly bracket:
$('#documentsDialog').dialog({
create: function(event, ui) {
var widget = $(this).dialog("widget");
$(".ui-dialog-titlebar-close span", widget).removeClass("ui-icon-closethick").addClass("ui-icon-myCloseButton");
}
});
But, most important, your css class should be declared as:
.ui-icon.ui-icon-myCloseButton{
background-image: url(https://www.goldbroker.com/pages/images/close.png);
}
The thing is that the definition at .ui-icon was overriding your custom image. When you redefine using the css above, it fully works.
Here, have a fiddle: http://jsfiddle.net/adrianonantua/FuWsK/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With