简体   繁体   English

禁用角落调整大小但在 JQuery 中保持水平/垂直调整大小?

[英]Disable corner resize but keep both horizontal/vertical resize in JQuery?

So I've been tinkering around with JQuery's resizable property and as of late, I've not found there to be a suitable type for what I'm trying to achieve.所以我一直在修补 JQuery 的resizable属性,最近,我还没有找到适合我想要实现的类型的类型。

The following example shows that you can resize both vertically and horizontally which is what I want, but you can also drag the corner box to resize which is not what I want.下面的示例显示您可以调整垂直和水平的大小,这是我想要的,但您也可以拖动角框来调整大小,这不是我想要的。 Is there a way to remove this box to make it resizable only by dragging the edges of the container?有没有办法删除这个框,使它只能通过拖动容器的边缘来调整大小?

 $( "#resizable" ).resizable();
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <div id="resizable" class="ui-widget-content"> <h3 class="ui-widget-header">Resizable</h3> </div>

check out their docs here: https://api.jqueryui.com/resizable/#option-handles在这里查看他们的文档: https://api.jqueryui.com/resizable/#option-handles

is this what you want to achieve?这是你想要达到的目标吗?

 $( "#resizable" ).resizable({ handles: "n, e, s, w" });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <div id="resizable" class="ui-widget-content"> <h3 class="ui-widget-header">Resizable</h3> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM