0

在我看来,我正在填充从具有 1000 多条记录的表中获取的内容。我必须以仅在向下滚动而不是立即将记录填充到较少记录的方式填充内容。我用它来开发移动应用程序。我已经尝试了各种在线资源,但在滚动的范围内没有效果。如果您仍然不清楚我的问题,那么你们中的大多数人可能都使用过 facebook。那里的帖子不会一次全部加载。只有在滚动时才会加载它们。我必须实现相同的功能。任何对实时代码的引用将不胜感激。提前致谢。

这是我获取记录的代码

@foreach (System.Data.DataRow row in Model.dtSearch.Rows)
{
if (Model.dtSearch.Rows.Count > 0)
    {
    <input type ="hidden" value="@row["ProductId"]" />
    <input type ="hidden" value="@row["ProductPriceId"]" />

    <div class="divSearchResult" id="divSearch">
    <table>
    <tbody>
    <tr><td rowspan="2" style="width:10%"> @Html.Raw(row["ThumbnailFilename"])</td>
    <td colspan="3"><div class="divSearchHeader"> @row["ProductName"] <br /></div></td></tr>
    <tr><td colspan="4"><div class="divSearchShowHide" ><a class="classShow" id="show" href="#" style="text-decoration:none">Show</a></div>
    <div style="display:none;" class="divSearchContent" id=divresult_@ProductDescription > @Html.Raw(row["ProductDescription"])</div></td></tr>
    </tbody>
    </table>
    <hr />
</div>

    }}

显示代码没有意义,但这是我必须实现功能的地方

4

1 回答 1

0

您可以使用jQuery Waypoints Infinite Scroll插件

$('.infinite-container').waypoint('infinite', {
  container: 'auto',
  items: '.infinite-item',
  more: '.infinite-more-link',
  offset: 'bottom-in-view',
  loadingClass: 'infinite-loading',
  onBeforePageLoad: $.noop,
  onAfterPageLoad: $.noop
});
于 2013-11-14T05:28:43.750 回答