【发布时间】:2017-03-03 10:30:28
【问题描述】:
我正在使用Addazle React grid。我需要实现无限滚动,但该网格没有实现它。所以我必须想出我的解决方案。 对于这项任务,我需要了解以下内容:
- 滚动事件处理程序上的网格。我有它,它可以正常触发。
- 找出滚动条在 React 元素上的位置。我需要弄清楚该怎么做。
我的想法是找出滚动条的位置,如果是最后一个,则在网格中加载更多项目。我正在考虑使用 JQuery 来完成这项任务。 这是呈现的 html:
<div class="react-grid-Viewport" style="overflow: hidden; position: absolute;" data-reactid="1"> <div style="position: absolute;overflow-x: auto;overflow-y: scroll; transform: translate3d(0px, 0px, 0px);">
<div style="width:1040px;overflow:hidden;">
<!--Items in the grid are stored here as divs-->
<!--Item One-->
<div style="background-color:#fff;">
<div>
</div>
</div>
<!--Item Two-->
<div style="background-color:#fff;">
<div>
</div>
</div>
<!--Item t-->
<div style="background-color:#fff;">
<div>
</div>
</div>
</div>
【问题讨论】:
标签: javascript jquery html css reactjs