I'm trying to make a simple Dialog - no title just the word 'Close' and the X in the top right hand corner. My text etc. will then go underneath.
However I fiddle with it I can't ever get the closeText attribute to display - I can see it in FireBug but it either doesn't appear, or a couple of characters appear under the X graphic.
Just do this (type it as it is, wherever you want to create a dialog),
Here I am editing the API's CSS properties through jQuery.
Actually the problem is the jQuery UI CSS and jQuery Dialog itself.
The jQuery UI Dialog does the following with whatever you pass in as
closeText
.<span></span>
which contains yourcloseText
ui-icon
andui-icon-closethick
' on itThe span is actually always created, no matter if you pass in
closeText
or not. It is used to display thex
-closing-image.Now looking into the default jQuery UI CSS we find for
ui-icon
Thus jQuery sets the text but the browser will never show it (
text-indent: -99999px
) and region too small for any text.So what I did is
Check this http://jsbin.com/ibibe/ for a working example
It sounds like you have not included the necessary jQuery UI CSS files, or there are some paths set incorrectly. Take a look at a working example using firebug and check to make sure all of the required files are being downloaded properly and that your paths are correct.
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
What I did is the following:
worked for me. hope this helps
example: http://jsbin.com/iyewa5
Just use this CSS to show the close icon: