我有元素有杂项高度。根据第一个块,我需要为其他元素添加一些margin-top。我被用于jQuery高度属性的这个动作,但它不起作用。你可以帮我吗?使用jQuery添加基于其他元素高度的顶部边距
这是我的代码:
$(document).ready(function(){
if ($('.post_discussion_header').height(79) + 'px'){
$('.no_0').css('margin-top','110px');
}
});
});
TIA。
您的if语句错了,您想要验证的是什么? – 2011-12-15 08:32:17