gpt4 book ai didi

css - 在 css 中设置固定 100% 高度侧边栏的滚动?

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

我有一个固定的 100% 高度侧栏,其中包含多个控件。

我试图让底部控件(绿框)在到达屏幕底部时滚动。

中间的控件是 Accordion 。

我使用表格行显示来自动调整侧边栏中的控件高度。

JSBIN

谢谢。

最佳答案

您需要指定绿色容器的高度才能使用 overflow-y:scroll。

你可以通过下面的jquery代码检测文档结束

if (  document.documentElement.clientHeight + 
$(document).scrollTop() >= document.body.offsetHeight )

{

alert("You're at the bottom of the page.");

在滚动的这一点上,您可以将 css 添加到绿色框,即高度:200 像素(或任何您想要的)

关于css - 在 css 中设置固定 100% 高度侧边栏的滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23403787/

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