Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将元素的边距底部更改为 next() 元素的高度加上 12px。我尝试了以下方法,但这不起作用。
$("div.entry-content").css("margin-bottom", $(this).next().outerHeight() + 12 + "px");
知道出了什么问题吗?
试试这个:
$("div.entry-content").css("margin-bottom", function(){ return $(this).next().outerHeight() + 12 + "px" })