I have a modal dialog that appears over a page that shouldn’t be accessed but should still be seen from outside of the modal dialog. I have everything working perfectly except for two problems:
- As soon as the modal dialog appears, the link within it is automatically focused, so there is a blue box around it (just like with any element onto which I am focused), but I don’t want this behavior.
- Also, there is an X button to allow the user to close the dialog, and I want to get rid of it.
Any help?
To prevent a jQuery UI dialog from ever being closed:
set the option
closeOnEscapetofalse:$(dlg).dialog('option', 'closeOnEscape', false);remove its close button just after creation:
$(dlg).parent().find('a.ui-dialog-titlebar-close').remove();register a NOOP
beforeclosehandler:$(dlg).bind('dialogbeforeclose', false);#1and#3can also be done during creation, of course.