我可以在open:event中更改对话框的尺寸吗?

时间:2012-03-03 09:53:31

标签: jquery jquery-ui

我已经创建了一个像这样的对话框:

this.dialog({
            autoOpen: false,
            modal: true,
            resizable: true,
            draggable: true,
            height: 'auto',
            width: 875,
            buttons: {
               ....<code here>
            },
            open: function (event, ui) {
                if ($(this).data('action') != "Editing HTML") {

是否有某种方法可以将“打开”内的高度和宽度更改为:

    width: $(window).width() - 20,
    height: $(window).height() - 20,

如果满足检查“行动”的上述条件?

1 个答案:

答案 0 :(得分:1)

是的,你可以:

您可以在初始化后更改任何/大多数对话框参数:

{{2p>检查dialog-options了解更多信息: