jquery - 我想使用 jquery 在静态表上进行无限滚动
问题描述
我有一个看起来像这样的 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.tableScroll,但我强烈建议使用较新的“vanilla JS”库,例如Clusterize来完成滚动表。
推荐阅读
- r - 在 nlme 中初始化相关结构时出错
- powershell - 递归迭代文件
- python - 查找百分比值数字和/或包含任意数量字符串的左括号时要拆分的 pandas 列
- oracle - 与在线 md5 生成器相比,MD5 oracle 函数提供不同的输出
- java - 如何根据多个子 div 找到父 div 的 xpath?
- javascript - 如何在多维javascript对象中获取关键dan值
- android - Android workmanager 作业在应用程序关闭后不运行(三星 s9+)
- python - 可以从 Tkinter Entry 小部件执行命令吗?
- sockets - 使用 Delphi 进行 Indy 查询
- reactjs - 从 aws 存储桶返回图像后,有没有办法调整图像大小