Jquery对话框动态按钮不可见

时间:2015-11-18 16:06:09

标签: javascript jquery jquery-ui

我想在对话框中添加动态按钮。我使用以下脚本但没有成功。按钮"关闭"扩展对话框时不会显示。我错了什么?

<head>
<link rel="stylesheet" type="text/css" media="screen" href="jquery-ui.css" />

<script src="jquery-2.1.4.min.js" type="text/javascript"></script>

<script src="jquery-ui.js" type="text/javascript"></script>

</head>

<body>

<div>

<div id="dialog">
    Dialog bodyyyy
</div>


</div>
<script>
var mydialog = $("#dialog").dialog({
            dialogClass: "noclose",
            resizable: false,
            modal: true,
            title: "Modal",
            height: "auto",
            width: "auto"
        });

var btns = mydialog.dialog("option", "buttons");

$.extend(btns, { "Close": function () { $("#dialog").dialog("close"); } });

mydialog.dialog("option", "buttons", btns);

</script>
</body>

0 个答案:

没有答案