简体   繁体   English

jQuery可调整大小的自动调整子项的父调整大小

[英]Jquery resizable auto resize children on parent resize

I'm using a jQuery UI resizable function so I can resize my elements in the page builder. 我正在使用jQuery UI可调整大小的函数,因此可以在页面构建器中调整元素的大小。

How can I auto re-size elements inside my column while I'm re-sizing that column? 在重新调整列大小时,如何自动调整列中元素的大小?

<div class="block-aq_column_block">
    <div id="element1"></div>
    <div id="element2"></div>
</div>

Now while I re-size block-aq_column_block , I want all elements inside it to re-size with it. 现在,当我调整block-aq_column_block的大小时,我希望其中的所有元素都随之调整大小。

I know that I should use alsoResize , but I just don't know how I can use it when there are multiple child elements. 我知道我也应该使用AlsoResize ,但是当有多个子元素时,我只是不知道如何使用它。 Any tips? 有小费吗?

add css to inner blocks : 将CSS添加到内部块中:

#element1{width: 100%;}
#element2{width: 100%;}

with height of inner block may be more complicated. 内块的高度可能会更复杂。 if hey have the same height - you can set 如果高度相同-您可以设置

#element1{height: 50%;}
    #element2{height: 50%;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM