0

在这里,我使用的是 jquery 对话框,但我必须禁用我的背景内容,以便用户不能单击任何按钮或不能选择任何内容。

但是怎么做。

<!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8" />
    <title>jQuery UI Dialog - Default functionality</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <script>
    $(function() {
    $( "#dialog" ).dialog();
    });
    </script>
    </head>
    <body>
    <div id="dialog" title="Basic dialog">
    <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
    </div>
    </body>
    </html>
4

4 回答 4

3

modal: true在对话框中设置:

$("#dialog").dialog({
    modal: true
});
于 2013-10-09T13:05:01.597 回答
2

您可以使用内置modal选项。

$( "#dialog" ).dialog({
     modal: true
});
于 2013-10-09T13:05:46.210 回答
1
$( "#dialog" ).dialog({
     modal: true
});
于 2013-10-09T13:06:16.587 回答
1

modal: true 选项添加到您的dialog,

$(function() {
   $( "#dialog" ).dialog({
       modal: true
   });
});

阅读对话框/#modal

于 2013-10-09T13:07:19.473 回答