我有一个项目列表,根据标准,它通过document.ready上的jQuery获得一个类,触发CSS3列。重新计算jQuery在元素更改后的元素高度
如果列表以列显示,它将具有较小的高度。有没有什么方法可以在课堂更改后立即在jQuery中获得新的高度?
$items.each(function(i){
var theItem = this;
console.log($(theItem).height());
//extended layout
if (theCriteria) {
$(theItem).addClass('extended');
console.log('after', $(theItem).height()); }
}
上面的代码返回两个调用的初始高度。我猜我需要触发别的东西。
难道你不能只检查改变类的代码的高度? – 2010-01-04 07:04:19
不行,它不起作用。我会在一秒内发布代码 – GreenDude 2010-01-04 07:08:33