🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

JS-分页插件

用于对数据分页显示

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/465550/1551954/JS-%E5%88%86%E9%A1%B5%E6%8F%92%E4%BB%B6.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Author
WhiteSevs
Version
0.0.1.20250312070906
Created
2023-05-05
Updated
2025-03-12
Size
24.8 KB
License
N/A

数据分页导航

  • 基本使用
let dataPaging = new DataPaging({
  data: [1, 2, 3, 4, 5, 6, 7, 8, 9], // 数组,里面具体什么值无所谓,需要的是它的长度用来分页
  pageShowDataMaxCount: 5, // 每一页显示的数据条数,如上面的数组共有9个,每页显示5个,会有2页
  pageMaxStep: 3, // 显示出来的按钮数量
  currentPage: 1, // 当前处于的第几个页码
  pageChangeCallBack: function (page) {
    // 当页码切换时发生的回调
    console.log(page);
  },
  /* 上一页按钮 */
  prevBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {} /* 点击事件回调 */,
  },
  /* 下一页按钮 */
  nextBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {},
  },
  /* 第一页按钮 */
  firstBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {},
  },
  /* 最后一页按钮 */
  lastBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {},
  },
});
  • 将分页视图追加到某个元素里
dataPaging.append(element:HTMLElement);
  • 动态修改上面的init的配置,如果当前数据长度改变的话可以使用它
dataPaging.changeConfig(details:Object);