this thread is a bit old... found via Google while searching for a solution to this problem.
like jitter explained, the problem is in how jQuery UI CSS handles the closeText option.
this from from jQueryUI @ jqueryui.com/demos/dialog/#option-closeText
(closeText) Specifies the text for the close button. Note that the close text is
visibly hidden when using a standard
theme.
What I did is the following:
// added a class to the dialog
$('.my-selector').dialog({dialogClass:'myclass'});
// jQuery UI CSS sets span.ui-icon to
// .ui-icon {display: block; text-indent:-99999px; overflow: hidden; background-repeat: no-repeat; }
// and .ui-icon { width: 16px; height:16px; background-image: url(....); }
// so unset default settings using the added class as selector:
$('div.myclass span.ui-icon').css({'display': 'inline', 'width': '100%', 'height':'100%', 'text-indent': 0,'overflow': 'visible'});
// now get the width of span.ui-icon
var uiIconSpanWidth = $('div.myclass span.ui-icon').width();
// calculate negative 'text-indent'
var offset = 5; // set offset
var textIndent = -(uiIconSpanWidth + offset);
textIndent = textIndent + 'px';
// reset css using textIndent as the value for the text-indent property
// (.. added 'line-height' and set its value to match the 'height' property so that the text is aligned in the middle..):
$('div.myclass span.ui-icon').css({'display': 'block', 'width': '16px', 'height': '16px', 'text-indent': textIndent, 'line-height': '16px',});
worked for me. hope this helps
example: http://jsbin.com/iyewa5