paginate show only 5 pages no code example
Example: pagination always show 5 pages
function pageRange(page,pageCount){
var start = page-2,
end = page+2;
if(end>pageCount){
start-=(end-pageCount);
end=pageCount;
}
if(start<=0){
end+=((start-1)*(-1));
start=1;
}
end = end>pageCount?pageCount:end;
return {start:start, end:end};
}