gpt4 book ai didi

javascript - 将加载的内容限制在 div 中

转载 作者:行者123 更新时间:2023-12-01 02:24:00 24 4
gpt4 key购买 nike

我有一个页面基本上是这样的:

<div id="thelist" style="height:100%; width:100%; position:relative"></div>

<script type="text/javascript">
$('#thelist').load('other.aspx', function () { });
</script>

问题是这样的:加载内容时,它会扩展到 div 边界之外并扩展到周围的控件中。有没有办法将此内容限制在 div 中,并且让 div 滚动以包含所有内容?谢谢。

最佳答案

是的,您应该能够通过将 css overflow 属性设置为 autoscroll 来实现此目的。
这是a good article详细说明了来龙去脉,这是 w3c specification .

关于javascript - 将加载的内容限制在 div 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7755131/

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