简体   繁体   English

在父div内调整子div的大小时如何隐藏div

[英]How to hide divs when resizing child divs inside a parent div

I have some divs inside a container, and each child div is jQuery resizable that handles e resize. 我在容器中有一些div,每个子div都是可调整大小的jQuery,可处理e调整大小。

My problem is when I try to resize the first child, the others jump outside the content div or outside when they reach the limits of their parent, 我的问题是,当我尝试调整第一个孩子的大小时,其他孩子在达到其父母的极限时会跳到content div之外或其他地方,

<div class="container">
    <div class="col"></div>
    <div class="col"></div>
    <div class="col"></div>
</div>

here you can see a working example. 在这里,您可以看到一个有效的示例。

What I need is, when resize any child none of them jump outside the parent or to a new line and if the parent reach the max-width hide the overflow. 我需要的是,在调整任何子级的大小时,它们都不会跳到父级之外或跳到新行,并且如果父级达到最大宽度,则隐藏溢出。

Any help will be great! 任何帮助都会很棒! Thanks in advance. 提前致谢。

The container is jumping to the new line because you set a range of 50-100px for the height in the css. 容器正在跳到新行,因为您为css中的高度设置了50-100px的范围。

Change 更改

max-height: 200px;

To

max-height: 50px;

on .container . .container

Here is a fiddle: http://jsfiddle.net/vS8vu/5/ 这是一个小提琴: http : //jsfiddle.net/vS8vu/5/

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

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