kPagination pagination plug-in
Pure js pagination plug-in, a compressed version of ~ 4kb, styles can be customized
Instructions
<div id="pagination"></div>
<script src="kPagination.min.js"></script>
<script>
new kPagination({
id: 'pagination',
currentPage: 1, // 当前页
totalPage: 20,
offset: 5,
showPrev: true,
showNext: true,
jumpPage: true,
jumpText: '跳转'
});
</script>
Configuration Item
Options |
Types of |
Explanation |
offset |
number |
The number of buttons can be displayed |
showPrev |
boolean |
Whether to display the Previous button |
showNext |
boolean |
Whether to display the Next button |
jumpPage |
boolean |
Jump whether the input box display |
jumpText |
string |
Jump button text |
pageChange |
function |
Page trigger callback |
afterRefresh |
function |
Re-render success callback |
Optional style
Options |
Explanation |
k-pagination-num-wrap |
Paging style container |
k-pagination-input-wrap |
Button style container |
K-pagination-whether |
Page Styles |
k-pagination-num-active |
Active style |
k-pagination-disabled |
Prohibition style |
k-pagination-num-input |
Input box style |
k-pagination-jump-btn |
Jump button style |
k-pagination-jump-dot |
Ellipsis style |
Attach github address , like a friend to a star of it, there can be feedback bug Ha, I will first fix