我有一个 jsfiddle http://jsfiddle.net/stevea/AbARW/3/其中图像最初配置为在所有四个角都有调整大小 handle 。当我单击该按钮时,我尝试使用
将其更改为仅在角落中的一个 handle $('button#changeHandles').click(function() {
$('img#pelican').resizable('option', 'handles', 'se');
});
但这似乎没有效果。有人看出问题了吗?
最佳答案
看来这是一个已知错误:ticket #3423
我使用.hide()整理了一个解决方法并冒昧地让你的按钮来回切换 handle ,而不是一次性使用。
<强> Working Example
$(function () {
$('img#pelican').resizable({
handles: 'ne,se,sw,nw',
aspectRatio: true
});
$('button#changeHandles').click(function () {
if ($('.ui-resizable-ne, .ui-resizable-nw, .ui-resizable-sw').is(':visible')) {
$('.ui-resizable-ne, .ui-resizable-nw, .ui-resizable-sw').hide();
} else {
$('.ui-resizable-ne, .ui-resizable-nw, .ui-resizable-sw').show();
}
});
});
关于jquery-ui - 无法使用选项更改调整大小 handle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17904358/