前端分页按钮算法
作者:互联网
var begin; var end; //总共显示10个页码 if(totalPage<10){ begin=1; end=totalPage; } else{ begin=currentPage-5; end=currentPage+4; if(begin<1){ begin=1; end=begin+9; } if(end>totalPage){ end=totalPage; begin=end-9; } } for(var i=begin;i<=end;i++){ //生成页码 }
标签:10,begin,end,分页,totalPage,算法,按钮,var,totalPagetotalPage 来源: https://www.cnblogs.com/LJP-JumpAndFly/p/10868730.html