简体   繁体   English

jQuery UI-使div不可调整大小

[英]jQuery UI - make div not resizable

I have a div that is made resizable using jQuery UI. 我有一个使用jQuery UI调整大小的div。 How can I dynamically make it not resizable anymore? 如何动态使其不再可调整大小? I tried calling resizable({ disabled: true }) but the handle still showed. 我尝试调用resizable({ disabled: true })但句柄仍然显示。

使用此代码:.resizable(“ destroy”)

Try .resizable("option", "disabled", true); 尝试.resizable("option", "disabled", true);

http://jqueryui.com/demos/resizable/#option-disabled http://jqueryui.com/demos/resizable/#option-disabled

Your solution is not working because, as per the documentation you need use the setter that I mentioned, if you want to disable it after initialization (you code will only work if its an initialization call) 您的解决方案无法正常工作,因为根据您需要的文档,请使用我提到的setter,如果您想在初始化后禁用它(您的代码仅在其初始化调用时才有效)

糟糕...我在启用它之前禁用了“可调整大小” ...

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

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