{"id":20011183,"url":"https://github.com/litten/pagectrl","last_synced_at":"2026-06-08T06:33:56.031Z","repository":{"id":19193564,"uuid":"22426744","full_name":"litten/PageCtrl","owner":"litten","description":"PageCtrl help to handle your paging problems.分页组件，用于处理页面分页问题。","archived":false,"fork":false,"pushed_at":"2014-07-31T07:23:48.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T02:16:07.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-30T12:24:52.000Z","updated_at":"2015-07-29T13:06:24.000Z","dependencies_parsed_at":"2022-09-25T04:51:44.475Z","dependency_job_id":null,"html_url":"https://github.com/litten/PageCtrl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/litten/PageCtrl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litten%2FPageCtrl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litten%2FPageCtrl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litten%2FPageCtrl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litten%2FPageCtrl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litten","download_url":"https://codeload.github.com/litten/PageCtrl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litten%2FPageCtrl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34051768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T07:24:41.228Z","updated_at":"2026-06-08T06:33:56.003Z","avatar_url":"https://github.com/litten.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#PageCtrl\n\n分页组件，用于前端页面处理分页问题。                    \n\n1. 支持AMD            \n2. 支持[grunt-imweb-tpl-complie](https://www.npmjs.org/package/grunt-imweb-tpl-complie)模版组件              \n3. 兼容所有浏览器                 \n4. 基于Jquery                \n\n### 使用 Usage:\n\n**1、实例化**\n\n```js\n/* @info new PageCtrl(ctn, fn)     \n * @param ctn {Dom} 目标节点           \n * @param fn {Function} 点击页码回调函数 cur-当前点击页码；pre-点击之前页面       \n */\n \nvar pc = new PageCtrl($('.sort-page'), function pageActionFn(cur, pre) {\n\tconsole.log('当前点击：'+cur + ', pre：'+pre);\n});\n```\n**2、初始化**\n\n```js\n/* @param total {Number} 总页码数；     \n * @param idx {Number} 当前页码，默认从1开始；       \n * @param max {Number} 最多显示数，可为空默认为5；限制页码区域，超出部分用…代替         \n */\n\npageCtrl.init({\n    'total': 100,\n    'idx': 1\n    'max': 5\n});\n```\n\n### 展示 Show:\n\n根据设定的`total, idx, max`3个值进行计算，将分页模块智能展示为几种不同样式。\n具体请查看[demo](http://littendomo.sinaapp.com/pagectrl/example.html)。\n\n![demo](http://littendomo.sinaapp.com/pagectrl/demo-img/0.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitten%2Fpagectrl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitten%2Fpagectrl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitten%2Fpagectrl/lists"}