【问题标题】:I want to make a infinite scroll on a static table using jquery我想使用 jquery 在静态表上进行无限滚动
【发布时间】:2020-10-11 14:02:35
【问题描述】:

我有一个看起来像这样的 html 表格:

<table class="data-table">
<thead>
    <tr>
        <th>Course</th>
        <th>Section</th>
        <th>Faculty</th>
        <th>Time</th>
        <th>Room</th>
        <th>Capacity</th>
        <th>Semester</th>
    </tr>
</thead>
<tbody>

    <tr>
        <td><a class="course" href="#">ACT201</a></td>
        <td>1</td>
        <td><a class="faculty" href="#">Ani</a></td>
        <td>MW 11:20 AM - 12:50 PM</td>
        <td>NAC993</td>
        <td>41(42)</td>
        <td><a class="semester" href="#">Spring 2020</a></td>
    </tr>

</tbody>

部分将有更多行。我想要做的是隐藏除前 50 行之外的所有行。当用户滚动到表格底部时,将显示另外 50 行,依此类推。

所以,基本上我想做的是在静态表上进行无限滚动(不使用 ajax 从另一个页面加载数据)。

我该怎么做?

【问题讨论】:

    标签: jquery scroll static infinite


    【解决方案1】:

    您可以尝试jquery.tableScroll,但我强烈建议使用更新的“vanilla JS”库,例如Clusterize 来完成滚动表格。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-02
      • 2019-07-05
      • 2012-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多