javascript - Close Dialog box when click outside -


i've read lot od asnwer how close jquery dialog box, can't of solutions posted work.

here's code.

function openpopup(element){ var = element; var dialog = $("#methods").dialog( {                 autoopen: false,                 modal: true,                 draggable: false,                 resizable: false,                 open: function() {                          $(".ui-dialog-titlebar-close").hide();              //this solution can't work             $('.ui-widget-overlay').bind('click', function() {                                           $('#methods').dialog('close');                     })             } });  //open dialog     dialog.dialog('open');  //set dialog position     $( "#methods" ).dialog(                  "option",                  "position",                  {                      my: "left bottom",                      at: "left bottom",                      of:                  }            );           } 

and call function onclick event html code

onclick="openpopup(this);" 

i think i'm missunderstanding important dialog box, can me?

one main problem .ui-widget-overlay div has no dimension inside page.

function openpopup(element){ var = element; $("#methods").dialog( {                 autoopen: false,                 modal: true,                 draggable: false,                 resizable: false,                 open: function( event, ui ){                   $(".ui-dialog-titlebar-close").hide();                   //this solution can't work                  $(document).on('click','.ui-widget-overlay', function() {                              $('#methods').dialog('close');                   });                }            });           } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -