【问题标题】:Resizable DIV only horizontally仅水平调整大小的 DIV
【发布时间】:2009-09-14 12:04:25
【问题描述】:

我需要一个插件来垂直调整 DIV 的大小,只需使用 jQuery(不是 jq UI)。这是 HTML 的示例:

<div class="wrapper" style="width:300px; height:300px; padding:50px; border:1px solid black;">

    <div class="resizable" style="height:300px; width:150px; background:green;float:left">

        TEST TEST

    </div>


    <div class="handle" style="width:10px; height:60px; float:left; margin-top:120px; background:red;"> </div>

</div>

谢谢。

【问题讨论】:

    标签: jquery resize drag


    【解决方案1】:
    jQuery('.resizable').css({
      'height': '150px'
    })
    

    如果你问得好,现在会有更多人回答。

    【讨论】:

      【解决方案2】:

      看看内置的height()函数:

      $(function ()
      {
          $(".resizable").height(300); // .resizable to 300px in height
      });
      

      【讨论】:

        猜你喜欢
        • 2018-10-05
        • 1970-01-01
        • 2017-08-30
        • 2014-10-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多