jQuery UI 可调整大小最小宽度太大

use*_*550 1 jquery jquery-ui

在下面的 jsfiddle 中 - 我重现了当前 jQuery UI 遇到的问题resize

当我尝试调整div当前1px宽度的大小时 - 它会自动增加大小,因此我无法将其恢复到原始大小(或任何小于新创建的div大小)。

有人遇到过这个问题吗?我尝试min-width: 1px;在 中标记 a.css但没有效果。

宽条的 CSS1px如下;

.Task
{
position: absolute;
height: 25px;
width: 1px;
background-color: Yellow;
cursor: move;
white-space:nowrap;
top: 0;
font-family: Corbel;
font-size: x-small;
line-height:2.5em;
text-indent: 0.5em;
z-index: 1;
border: 2px outset;
border-bottom: 1px solid black;
}
Run Code Online (Sandbox Code Playgroud)

提前致谢,

http://jsfiddle.net/cyVYq/24/

Pau*_*ida 5

你很接近。您需要minWidthresizable属性中设置,而不是在 CSS 中设置。默认值为minWidth10,但您可以将其设置为 1 以获得所需的行为。

.resizable({
    //containment: "parent",
    minWidth: 1,
    handles: 'e, w',
});
Run Code Online (Sandbox Code Playgroud)

更新后的 jsFiddle