誰でも私を助けることができますか、エラーがどこにあるのかわかりません。
これは私のjQueryです:
function altezzadotgrey(){
$('.views-field-title').each(function(){
var aaltezzadotgrey = $(this).outerHeight();
if ($(this).outerHeight() > 40) {
$(this).css("margin-top", "-45px");
}
});
}
これは私のHTMLです:
<div class="views-row">
<div class="views-field-title">
<span class="field-content"><a href="">a</a></span>
</div>
</div>
<div class="views-row">
<div class="views-field-title">
<span class="field-content"><a href="">b</a></span>
</div>
</div>
<div class="views-row">
<div class="views-field-title">
<span class="field-content"><a href="">c</a></span>
</div>
</div>
<div class="views-row">
<div class="views-field-title">
<span class="field-content"><a href="">d</a></span>
</div>
</div>
に問題がある可能性があると思いますeach()
。