gpt4 book ai didi

jquery - 根据添加到数字的变量设置边距

转载 作者:行者123 更新时间:2023-11-28 11:13:46 26 4
gpt4 key购买 nike

我正在尝试将元素的底部边距更改为 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"
})

关于jquery - 根据添加到数字的变量设置边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12122948/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com