jQuery调整大小不能正常工作

时间:2012-05-07 12:59:40

标签: javascript jquery jquery-ui

首先,我不能把演示放在jsFiddle中,因为它太大了 Demo
双击配置图标打开窗口,现在如果您调整窗口大小,内容溢出,如果再次调整大小,则可以,等等。这是为什么这个问题? (调整大小一次,不一次..) 以下是相关代码:

调整事件处理程序的大小:

$('.window-container').live('resize', function(){
    var window = $(this).data('window');
    window.setWidth(window.windowContainer.width());
    window.setHeight(window.windowContainer.height());       
    window.repaint();
});


重绘方法(仅相关代码):

JWindow.prototype.repaint = function(){ 
    this.windowContainer.hide();
    if (this._visible && !this._minimized) this.windowContainer.show();
    this.windowContainer.css('position', 'abosolute');
    this.windowContainer.css('left', this.getLeft());
    this.windowContainer.css('top', this.getTop());
    //Resizable    
    this.windowContainer.resizable('disable');
    if (this._resizable){
        this.windowContainer.resizable({
            containment: 'parent',
            ghost: true,
            animate: false,
            minHeight:100,
            minWidth:this.titleLabel.textWidth()+120
        });
        this.windowContainer.resizable('enable');
    }
    this.windowContentContainer.css('height',this.windowContainer.innerHeight()-this.titleBarContainer.height()-20);
}

1 个答案:

答案 0 :(得分:0)

嗯,这不是正确答案,我无法弄清楚问题,所以我重新编码了所有调整大小的代码..