我有两种不同的方法来使用 Jquery 创建对话框
这个不起作用:
var options = "{width: 1024, height: 600, modal: true, buttons: { Cancelar: function () { $(this).dialog('close'); } }, draggable: false, resizeble: false}";
$('#UserSettings').dialog(options);
这个效果很好:
$('#UserSettings').dialog({ width: 1024, height: 600, modal: true, buttons: { Cancelar: function () { $(this).dialog('close'); } }, draggable: false, resizeble: false });
不明白为什么。
最佳答案
删除第一个选项中的引号。对话框的参数是一个对象而不是字符串。
var options = {
width: 1024,
height: 600,
modal: true,
buttons: {
Cancelar: function () {
$(this).dialog('close');
}
},
draggable: false,
resizeble: false
};
关于jquery - 创建 jquery 对话框的 2 种方法。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13405234/