Browse Source

adjust pagination display slider

master
JoBCB 3 years ago
parent
commit
3a9c117c2d
  1. 16
      templates/browsethearchive.html

16
templates/browsethearchive.html

@ -47,11 +47,12 @@
<script type="text/javascript"> <script type="text/javascript">
//Pagination https://www.javaer101.com/en/article/123201810.html //Pagination https://www.javaer101.com/en/article/123201810.html
pageSize = 4; pageSize = 24;
incremSlide = 5; incremSlide = 5;
startPage = 0; startPage = 0;
numberPage = 0; numberPage = 0;
var pageCount = $(".browsethearchive-items").length / pageSize; var pageCount = $(".browsethearchive-items").length / pageSize;
var totalSlidepPage = Math.floor(pageCount / incremSlide); var totalSlidepPage = Math.floor(pageCount / incremSlide);
@ -99,10 +100,10 @@ slide = function(sens){
next.show(); next.show();
prev.show(); prev.show();
} }
} }
slide();
showPage = function(page) { showPage = function(page) {
$(".browsethearchive-items").hide(); $(".browsethearchive-items").hide();
$(".browsethearchive-items").each(function(n) { $(".browsethearchive-items").each(function(n) {
@ -121,11 +122,11 @@ var activeLink;
$("#pagin li a").click(function() { $("#pagin li a").click(function() {
$listItems.removeClass('current'); $listItems.removeClass('current');
$(this).addClass('current'); $(this).addClass('current');
var activeLink=$(this); var activeLink=$(this);
showPage(parseInt($(this).text())); showPage(parseInt($(this).text()));
}); });
@ -142,6 +143,7 @@ $(".prev").click(function() {
showPage(--i); showPage(--i);
} }
}); });
$(".next").click(function() { $(".next").click(function() {
let nextLi = $("#pagin li a.current").parent().next().find("a"); let nextLi = $("#pagin li a.current").parent().next().find("a");

Loading…
Cancel
Save