gpt4 book ai didi

jquery - 如何通过 jquery 更改按钮的位置和页面高度?

转载 作者:行者123 更新时间:2023-11-27 23:33:51 24 4
gpt4 key购买 nike

我有一个在页面中滚动的按钮,它的样式是:

button{
top: auto;
bottom: 0%;
}

现在我想改变那个位置,这样:bottom = $(document).height() - 10rem.
我该怎么做?

最佳答案

可以使用css方法(以像素为单位):

var heightVal = $(document).height() - 10;
$("button").css("height", heightVal + 'px');

关于jquery - 如何通过 jquery 更改按钮的位置和页面高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57349566/

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