【问题标题】:Is there a way to set jQuery resizable containment to own figures.?有没有办法将 jQuery 可调整大小的包含设置为自己的数字。?
【发布时间】:2017-05-14 19:36:21
【问题描述】:

正如问题所暗示的,我需要一种方法来设置我自己的可调整大小的元素包含。 jQuery 只有 parent 选项,这不是该项目中的选项。那么有没有办法将可调整大小元素的包含设置为特定数字而不是父元素或其他元素..?

        $(e).resizable({
            containment:'parent'// i wonna set my own figures instead....
        });

【问题讨论】:

  • 似乎有一个bunch of options 用于收容
  • 一个在哪里..?
  • 你可以给它一个带有包含元素的选择器。当新元素存在时,您可以稍后定义容器。等
  • @James,老兄,你是个天才!谢谢...

标签: javascript jquery html css jquery-ui-resizable


【解决方案1】:

您可以将 jquery resizable 直接应用于 img 标签。

      <img id="resizable" src="ur image url" />

  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#resizable" ).resizable();
  } );
  </script>

请参考: http://jsbin.com/jiwehasofo/1/edit?html,output

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-27
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-30
    相关资源
    最近更新 更多