自动高度计算div [英] Auto height calculation of div
问题描述
我需要计算 content
div height,并将其应用于 wrapper
div。
我有脚本,但这里的问题是,我有自动增长 text-area
code> content div动态增加 text-area
和内容
如何自动将已生成的div高度应用于 wrapper
div。我想要 wrapper
div也与 content
div一起成长。
< div class =wrapper>
< div class =content>
< p> lorem ipsum elit sitrialm ipsum elit sitrialm ipsum elit sitlorem ipsum elit sifgfgfgfgfgfgfgfgfgfgtlorem ipsum elit sitransm ipsum elit dfdfdfdfdfdfdsitlorer ipsum elit sititre ipsum elit sititre ipsum elit sitlore
< textarea>< / textarea>
< / p>
< / div>
< / div>
PS:我无法更改 请在resize函数中添加以下行: I need to calculate the I have script which does that but the problem here is, I have auto grow How do I automatically apply the grown div height to the P.S: I can not change the Please add below lines in resize function
这篇关于自动高度计算div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! / code
var contentHeight = box.parents(。content)height ;
$(。wrapper)。css({min-height:contentHeight + 40});
content
div height and apply it to the wrapper
div. text-area
inside the content
div which increases the text-area
and content
height dynamically while typing inside.wrapper
div. I want wrapper
div also to grow along with content
div.<div class="wrapper">
<div class="content">
<p>lorem ipsum elit sitlorem ipsum elit sitlorem ipsum elit sitlorem ipsum elit sifgfgfgfgfgfgfgfgfgtlorem ipsum elit sitlorem ipsum elit dfdfdfdfdfdfdsitlorem ipsum elit sitlorem ipsum elit sitlorem ipsum elit sitlore
<textarea></textarea>
</p>
</div>
</div>
position:absolute
of the .Content
div var contentHeight = box.parents(".content").height();
$(".wrapper").css({"min-height":contentHeight+40});