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

查看:336
本文介绍了如何使用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天全站免登陆