可调整大小的jQuery UI最小宽度过大 [英] jQuery UI resizable Min width is too large

查看:255
本文介绍了可调整大小的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;
}

预先感谢

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

推荐答案

您已经关闭.您需要在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',
});

更新了jsFiddle .

这篇关于可调整大小的jQuery UI最小宽度过大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆