gpt4 book ai didi

android - 试图将元素保留在页面底部

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

在 android 中,我在将我的 div/bg 图像保留在页面底部时遇到了很大的问题。

所以我试图在您滚动时移动整个侧边栏元素,但我的数学/代码有些问题。

因此,我向您提供这种尝试,以发现我的逻辑问题:

   jQuery(window).scroll(function() {
var y = jQuery(this).scrollTop();
var current = jQuery('.side-bar').css('background-position', '-43px', '0%' + parseInt(+y / 10) + '%');
current();
console.log(current;);
});

最佳答案

尝试使用 DIV 并使用 position:fixedbottom:0px;

关于android - 试图将元素保留在页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13767988/

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