最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery-UI resizable disabled is true but handles still shows up - Stack Overflow

programmeradmin1浏览0评论
$('.box').resizable({
  disabled: true
});

and here's the CSS

.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
  display: none;
}

According to the docs, when disabled is true, the .ui-resizable-disabled class gets added to the element. In my case the classes does not get added but the resizing is still disabled (meaning I can't resize by dragging the handles, but when disabled is false I can resize). When I check the generated HTML, style="display:block" was added to the handles. I'm not doing any show hide on them.

<div class="ui-resizable-handle ui-resizable-e" style="display: block; ">...</div>

I'm using jQuery 1.8 from Google API. I'm also applying draggable to the same elements.

$('.box').resizable({
  disabled: true
});

and here's the CSS

.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
  display: none;
}

According to the docs, when disabled is true, the .ui-resizable-disabled class gets added to the element. In my case the classes does not get added but the resizing is still disabled (meaning I can't resize by dragging the handles, but when disabled is false I can resize). When I check the generated HTML, style="display:block" was added to the handles. I'm not doing any show hide on them.

<div class="ui-resizable-handle ui-resizable-e" style="display: block; ">...</div>

I'm using jQuery 1.8 from Google API. I'm also applying draggable to the same elements.

Share Improve this question asked Apr 12, 2012 at 4:46 Aen TanAen Tan 3,3456 gold badges35 silver badges53 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 9

Looks like its a default behavior. You can not resize though there is a handler. Anyways, you could hide the handler as:

//Dirty hack
$('div.ui-resizable-handle').hide();

//Somewhat effective solution
$( "#resizable" ).resizable({ disabled: true, handles: 'e' });

Demo : http://jsfiddle/codef0rmer/W7HQ9/

you can just hide the handle as below, this will only remove the handle image and you could still do the re-size..

$("#yourelementid").find('.ui-icon').removeClass('ui-icon');
发布评论

评论列表(0)

  1. 暂无评论