如何使用 jQuery UI Resizable 仅水平或垂直调整大小? [英] How to resize ONLY horizontally or vertically with jQuery UI Resizable?

查看:38
本文介绍了如何使用 jQuery UI Resizable 仅水平或垂直调整大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

The only solution I've found is to set the max and min height or width with the current value.

示例:

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

但这真的很难看,特别是如果我必须以编程方式更改元素的高度.

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

推荐答案

您可以设置调整大小 handles 选项 只显示在左右(或东/西),像这样:

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'
});​

你可以在这里试一试.

这篇关于如何使用 jQuery UI Resizable 仅水平或垂直调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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