jQuery UI调整大小自定义句柄,而不是调整大小元素的子元素 [英] jQuery UI resize custom handles, not children of the resized element

查看:74
本文介绍了jQuery UI调整大小自定义句柄,而不是调整大小元素的子元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为不是该元素子元素的jQuery UI可调整大小元素提供自定义句柄.我尝试按照 jQuery UI文档页面上的说明进行操作,但是我可以使其无法正常工作,并且会耗尽为什么的想法.

I need to have custom handles for jQuery UI resizable elements that are not children of this element. I tried doing it the way it's documented on jQuery UI documentation page but I can't get this to work and am running out of ideas why.

这是我的示例设置(不起作用):

This is my example setup (not working):

HTML

<div id="wrapper">
  <div id="resize-me"></div>
</div>

<div class="ui-resizable-handle ui-resizable-n" id="n-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-e" id="e-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-s" id="s-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-w" id="w-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-ne" id="ne-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-se" id="se-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-sw" id="sw-resize-handle"></div>
<div class="ui-resizable-handle ui-resizable-nw" id="nw-resize-handle"></div>

JS

$('#resize-me').resizable({
  handles: {
    n: $('#n-resize-handle'),
    e: $('#e-resize-handle'),
    s: $('#s-resize-handle'),
    w: $('#w-resize-handle'),
    ne: $('#ne-resize-handle'),
    se: $('#se-resize-handle'),
    sw: $('#sw-resize-handle'),
    nw: $('#nw-resize-handle')
  }
});

我在 codepen.io

我在网上搜索了如何实现类似示例的示例.也许这里有人做到了,可以指出我想念的是什么?

I searched all over the net for examples of how to implement something like that. Maybe someone here has done that and could point out what I'm missing?

我已经看到这个SO问题,但我认为这不是重复的因为答案的作者说,答案不适合生产代码.

I already seen this SO question but I think it's not a duplicate because the answer to that is not viable for production code, as stated by the answer's author.

任何帮助将不胜感激.

推荐答案

这不是您想要的答案,但是-这是jQuery UI的一个开放(未解决)错误. http://bugs.jqueryui.com/ticket/9658

Not the answer you were hoping for, but - this is an open (unresolved) bug with jQuery UI. http://bugs.jqueryui.com/ticket/9658

更新:此错误已在2015年3月发布的jQueryUI 1.11.4中修复.

Update: this bug was fixed in jQueryUI 1.11.4, which was released in March 2015.

这篇关于jQuery UI调整大小自定义句柄,而不是调整大小元素的子元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆