2

要素のmargin-bottomをnext()要素の高さに12pxを加えた高さに変更しようとしています。次のことを試しましたが、うまくいきません。

$("div.entry-content").css("margin-bottom", $(this).next().outerHeight() + 12 + "px");

何がうまくいかないのか分かりますか?

4

1 に答える 1

3

これを試して:

$("div.entry-content").css("margin-bottom", function(){
    return $(this).next().outerHeight() + 12 + "px"
})
于 2012-08-25T14:51:49.233 に答える