我有一个页面基本上是这样的:
<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
属性设置为 auto
或 scroll
来实现此目的。
这是a good article详细说明了来龙去脉,这是 w3c specification .
关于javascript - 将加载的内容限制在 div 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7755131/