简体   繁体   中英

jquery modal dialog is laughing at me - dialog shows up modeless

I got stuck trying to show a simple jquery modal dialog. The dialog is shown but in a modeless way.

I have read other posts and checked:

  • There is a link to jquery-ui.css
  • I've included modal:true parameter.

What am I doing wrong?

HTML

<div id="userPanelDlg">
    <div class="input -clearfix">
        <p>User</p>
        <input name="username" type="text">
        <p>Pass</p>
        <input name="password" type="text">
    </div>
</div>

Javascript

$("#userPanelDlg").dialog({
    resizable: false,
    height: 'auto',
    width: 'auto',
    modal: true,
    buttons: {
        "Ok": function () {
            $(this).dialog("close");
        }
    }
});

I found the problem. I misunderstood a basic javascript concept. The dialog IS shown as modal but the execution follows after dialog() call. I thought that, as in other languages like java, dialog({modal:true}) was a blocking call (like dialog.setVisible(true) in java). Thx for your help anyway

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM