【发布时间】:2016-06-01 23:19:10
【问题描述】:
我有一个 div 并且不止一个数据通过 jstl 标签进入这个 div。我想找到最大内容 div 高度。 我看过一个链接,但每次 20 时都会显示警报。 element with the max height from a set of elements
JSP
<div id="div-height" class='cat-product-name'>${i.name} </div>
JAVA 脚本
$(window).load(function () {
var maxHeight = Math.max.apply(null, $("#div-height").map(function ()
{
return $(this).height();
}).get());
alert(maxHeight);
});
我想找到 div 的最大高度并设置每个 div 的高度。
【问题讨论】:
标签: javascript jquery jsp jstl