可调整大小的jQuery UI最小宽度过大
在下面的jsfiddle中-我重现了jQuery UI resize
当前遇到的问题.
In the following jsfiddle - I've reproduced an issue that I'm currently having with the jQuery UI resize
.
当我尝试调整当前为1px
宽的div
的大小时-它会自动增大大小,结果我无法将其恢复为原始大小(或小于新创建的div
大小).
When I try to resize the div
that is currently 1px
wide - it automatically increases in size and as a result I can then not get it back don to it's original size (or any smaller than the newly created div
size).
有人遇到过这个问题吗?我尝试在.css
中标记min-width: 1px;
,但这没有效果.
Has anyone encountered this issue? I tried tagging a min-width: 1px;
in the .css
but that had no effect.
1px
宽条的CSS在下面;
CSS for the 1px
wide bar is below;
.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;
}
预先感谢
您已经关闭.您需要在resizable
属性中而不是在CSS中设置minWidth
. 默认minWidth
为10 ,但是您可以将其设置为1以获取您的期望的行为.
You were close. You need to set minWidth
in the resizable
properties, and not in the CSS. The default minWidth
is 10, but you can set it to 1 to get your desired behavior.
.resizable({
//containment: "parent",
minWidth: 1,
handles: 'e, w',
});