gpt4 book ai didi

jquery - 萨斯/CSS : Stop fixed div from scrolling along with parent div

转载 作者:行者123 更新时间:2023-11-28 04:11:55 25 4
gpt4 key购买 nike

我有这两个 div:包含一组过滤器的父 div #filterSelect,以及它的子 div #applyFilterIKnow,它是“应用过滤器”按钮。 #applyFilterIKnow 应该始终可见并固定在 #filterSelectdiv 的底部。问题是 #applyFilterIKnow#filterSelect 一起滚动。这是两者的 CSS:

#filterSelect {
transform: translateX(100%);
transition: transform 0.3s;
overflow-x: auto;
overflow-y: auto;
width: 15%;
position: absolute;
z-index: 1000;
right: 0;
height: 100%;
}

#applyFilterIKnow {
position: fixed;
width: 100%;
height: 50px;
bottom: 0;
right: 0;
background-color: #4370d9;
transition: all 0.5s ease;
font-size: 2rem;
padding-top: 10px;
text-align: center;
color: white;
cursor: pointer;
}

我省略了一些与背景颜色相关的CSS。据推测,解决方案之一是将 #filterSelect 的位置设置为 relative,但这会使整个 div 与页面的其余内容重叠。我能做些什么?提前感谢任何回答我的疑问的人:(

以下是与问题相关的一些屏幕截图:

enter image description here enter image description here

最佳答案

问题是,你的 parent 也是绝对的。绝对(或固定)定位的元素在绝对定位的父元素中托管时表现不同:它们仍然遵循其父元素的约束。

唯一可能的方法(我知道)是将固定元素移出其父元素。

关于jquery - 萨斯/CSS : Stop fixed div from scrolling along with parent div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42673344/

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