jquery ui resizable custom handle error

前端 未结 2 744
独厮守ぢ
独厮守ぢ 2021-01-28 06:38

Im trying to get a custom handle work with jquery ui resizable widget, but when I use the handles option to pass in a jquery reference to another element, it fails. From what Iv

相关标签:
2条回答
  • 2021-01-28 07:17

    This is a bug that has been fixed very recently:

    http://bugs.jqueryui.com/ticket/8713

    https://github.com/jquery/jquery-ui/commit/9b908878ae3a9c0fbbd9958b579f223a648c5c69

    0 讨论(0)
  • 2021-01-28 07:20

    I found a workaround.

    By setting the handles option to null, and setting the classes myself, I got my custom handle to work. This required some investigation in the jquery ui code to figure out.

    <div class="layer" style="width: 150px;">
    <div class="left">left</div>
    <div class="center">center</div>
    <div class="right ui-resizable-handle ui-resizable-e">right</div>
    </div>
    ​
    $('.layer').resizable({
        handles: null
    });
    ​
    

    http://jsfiddle.net/MatteS75/3dwVp/7/

    However, I do think this is a jquery ui bug, releated to this question: overriding a jquery ui widget string option with an object

    0 讨论(0)
提交回复
热议问题