Search code examples
jqueryjquery-uidialogjquery-ui-dialog

How do I move the close button on a jQuery UI dialog box?


I'd like to move the close button in the top right hand corner of the UI Titlebar away from the actual titlebar. I've looked through the documentation and through other SO questions but can't find the solution.

Has anyone ever done this before.

n.b. I can remove the titlebar but that also removes the close button, similarly I can remove the close button or move it anywhere on the titlebar but not away from the titlebar.

Thanks


Solution

  • In the end, I hid the title bar and close button and inserted an image which closed the dialog box :-)

    <img src="close-window.png" onclick="$('#dialog-learn').dialog('close');" style="float:right;">