1

当我在打开对话框后增加对话框的大小时,对话框的高度和宽度会增加,但对话框标题栏的宽度不会增加。我只是不明白为什么会这样。

这是我的代码:

<style type="text/css">
    .BusyStyles {
        background-image: url('../images/ajax-loader.gif');
        background-repeat: no-repeat; background-position: center center; 
        height: 80px;
        width: 180px;
    }
</style>

<script type="text/javascript">
    $("#dialog").dialog({
        autoOpen: false,
        height: 80,
        width: 180,
        modal: false,
        draggable: true,
        resizable: false,
        position: 'center',
        show: {
            effect: "fade",
            duration: 2000
        },
        hide: {
            effect: "fade",
            duration: 500
        }
    });

    $("#dialog").removeClass('ui-dialog-content ui-widget-content').addClass('BusyStyles')
    $("#dialog").dialog("open");
</script>


在另一个按钮上单击我正在增加对话框的大小,如下所示:

$(".ui-dialog").animate({
    left: $(document).width() / 2 - $("#dialog").width() / 2, 
    top: $("#dialog").top
}, 1000);

我需要在我的代码中添加什么,以便结果对话框标题宽度会随着对话框宽度的增加而增加?

谢谢

4

2 回答 2

2

您应该使用该option方法来增加对话框大小:

$( "#dialog" ).dialog('option', 'width', 600);
于 2011-10-28T12:22:11.887 回答
1

例如,使用 FireBug 查看哪个 div 是对话框的所有其他 div 的父容器(jQuery 对话框是从许多 div 元素构建的)。然后,您将确定您正在调整正确的 div 大小。并且标题栏肯定会调整大小......

于 2011-10-28T12:20:38.253 回答