H5 List Page: Back-to-Top + Pagination (Inspired by the JD.com App)

Add-ons
2026-07-25 22:45 3 次浏览 • 0 次下载 12.6KB
H5 List Page: Back-to-Top + Pagination (Inspired by the JD.com App)

Note: This plugin imitates the back-to-top button in the JD.com app. It does not include number animation effects. Please be aware of this.

Usage:

1. Before importing this plugin, import zepto.min.js or jquery.js.

1
<script type="text/javascript" src="zepto.min.js"></script>

2.

1
2
3
4
5
6
7
8
9
10
11
12
var page_instance = $('#your-gotop-dom-id').pageination({
// Whether to always display
always: false,
// Height at which pagination starts displaying. Pagination appears only after this height is reached. If always is not true, it will remain visible.
startPos: 300,
// Step height. The current page number increases or decreases by 1 for every scroll of this distance.
stepHeight: 700,
// Total number of pages. Required.
total: 5,
// Time for the pagination icon to change into the back-to-top icon. When the current page is the first page, this is the duration from when the back-to-top icon appears until it disappears.
time: 1000
});
  • page_instance instance object, containing the parameters you pass, the DOM object it operates on, and two functions:

  • updateTotal: Updates the total number of pages

  • updateCul: Updates the current page number

星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare