Reputation: 28505
I'm trying to have the margin-bottom of an element being altered to the height of the next() element plus 12px. I tried the following, but this doesn't work.
$("div.entry-content").css("margin-bottom", $(this).next().outerHeight() + 12 + "px");
Any idea what goes wrong?
Upvotes: 2
Views: 82
Reputation: 144709
Try this:
$("div.entry-content").css("margin-bottom", function(){
return $(this).next().outerHeight() + 12 + "px"
})
Upvotes: 3