I am trying to create a button that closes the dialog box in the jQuery user interface.
To open the dialog, I use this code:
$(".show .edit_site").click(function (){ rel = $(this).attr("rel"); $("#dialog_edit").dialog({ modal: true, open: function () { $(this).load("<?= site_url()?>/sites/show_update?id="+rel+"&mode=popup"); }, close: function() {
The dialogue is open and everything is in order. But now the question is, how to close the dialog box by clicking the button inside the dialog box?
Thanks everyone and sorry for my scary english :)
I tried all possible solutions, this is the only one that works for me:
function close_dialog() { //Close jQuery UI dialog $(".ui-dialog").hide(); $(".ui-widget-overlay").hide(); }
source share