我找到的唯一解决方案是用当前值设置最大和最小高度或宽度.

Example:

foo.resizable({ 
  maxHeight: foo.height(), 
  minHeight: foo.height() 
});

But this is really ugly, especially if I have to change the element's height programmatically.

推荐答案

You could set the resize handles option to only show on the left and right (or east/west), like this:

foo.resizable({
    handles: 'e, w'
});​

You can give it a try here.

Jquery相关问答推荐

jQuery中的多个 Select 器链接?

为什么 jQuery 不使用 requestAnimationFrame?

jQuery $(document).ready () 触发两次

jQuery 与 ExtJS

使用 jQuery 的并行异步 Ajax 请求

使用 bootstrap-datepicker 检测对选定日期的更改

jQuery 中 prop() 和 attr() 的区别以及何时使用 attr() 和 prop()

jQuery.parseJSON 与 JSON.parse

将数据传递给 jQuery UI 对话框

Bootstrap 3.0 弹出框和工具提示

jQuery .load() 调用不会在加载的 HTML 文件中执行 JavaScript

使用 时如何从 select2 中获取选定文本

Jquery .show() 不显示隐藏可见性的 div

获取跨域 iframe 的 DOM 内容

滚动 DIV 元素时如何防止页面滚动?

javascript jquery单选按钮单击

如何在jQuery中 Select 最后一个子元素?

jQuery向左滑动并显示

jQuery 使用 AND 和 OR 运算符按属性 Select

如何使用 jQuery 的 form.serialize 但排除空字段