pager = function (divPager, pageIndex, pageSize, totalCount, pageChange, opt) {
var theOpt = { barSize: 5, //The number of pages displayed in the paging bar barTemplate: "{bar} total {totalPage} pages {totalCount} items {goto}", //Show template autoHide: true, //Whether to automatically hide showFirst: true, //In totalPage>barSize Whether to automatically display the first page link showLast: true, // Whether to automatically display the last page link when totalPage>barSize showGoTo: true, // Whether to display GoTo autoHideGoTo: true / /If there are too few, whether to automatically hide GoTo };
if (opt) { if (opt.barSize) theOpt.barSize = opt.barSize; .barTemplate) theOpt.barTemplate = opt.barTemplate; if (opt.autoHide == false) theOpt.autoHide = false; if (opt.showFirst == false) theOpt.showFirst = false; if (opt.showLast = false) theOpt.showLast = false; if (opt.showGoTo == false) theOpt.showGoTo = false; if (opt.autoHideGoTo == false) theOpt.autoHideGoTo = false; ));
if (!myPagerChanges[divPager]) myPagerChanges[divPager] = pageChange;
var startPage = 0; //Paging bar start page var endPage = 0; //Paging bar termination page var showFirst = true; var showLast = true;
var barHtml = ""; //Page bar barHtml = pageIndex == 1 ? "" : _getLink(pageIndex - 1, "Previous page"); if (theOpt.showFirst) { barHtml = _getLink(1) "..."; } for ( var index = startPage; index <= endPage; index ) {
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn