如何获取div中最高元素的高度并将此高度设置为div? [英] How to get height of the highest element in the div and set this height to the div?
本文介绍了如何获取div中最高元素的高度并将此高度设置为div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我写了一个小新闻行情- http://jsfiddle.net/MrTest/SvFRs/
I wrote small news ticker - http://jsfiddle.net/MrTest/SvFRs/
我遇到的问题是-新闻div之后有内容straigt,我需要知道该div中最重的元素的高度(并将此高度设置为div(parent)),所以我将避免移动下方的元素.
Problem which I have is that - there is content straigt after news div and I need to know the height of the heighest element in that div (and set this height to the div(parent) ), so I would avoid movement of element underneath it.
请参阅我的示例- http://jsfiddle.net/MrTest/SvFRs/
非常感谢您的帮助.
Pete
推荐答案
看这个jsFiddle:
look this jsFiddle:
我将背景设为灰色以查看其是否有效
i made the background gray to see if it works
这篇关于如何获取div中最高元素的高度并将此高度设置为div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文