调整大小时,jQuery的Resizable Div的Width和Height变为0

5 javascript css jquery jquery-ui jquery-ui-resizable

我有以下代码:

<table>
    <tr>
        <td id="parent">
            <div id="child"></div>
        </td>
    </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

我的JavaScript代码:

$('#child' ).resizable({
    animate: true,
    helper: '.ui-resizable-helper',
    maxWidth: 500,
    maxHeight: 500,     
    aspectRatio: true
});
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,我的可调整大小功能div可以按预期工作,但是当我添加containment选项时,将divs widthheight调整0为时,无论在任何方向进行调整。

   $('#child' ).resizable({
        animate: true,
        helper: '.ui-resizable-helper',
        maxWidth: 500,
        maxHeight: 500,     
        aspectRatio: true,
        containment: '#parent'
    });
Run Code Online (Sandbox Code Playgroud)

为什么会这样呢?是虫子吗?