
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@jemmyphan/js-pagination
Advanced tools
pagination implemented in pure JavaScript
// install
npm i -S 'js-pagination'
// run example
git clone https://github.com/rainjay/pagination.git
cd pagination
npm install
npm run dev
require('js-pagination/dist/styles.css')
var Pagination = require('js-pagination')
// config
Pagination.config({
ulClass: 'pagination',
activeClass: 'active',
...
})
// use
var myPager = new Pagination(100, 15, function(page) {}, '.field')
myPager.getCurrentPage()
myPager.goToPage(num)
// html
<div class="field"></div>
key | Type | Details |
---|---|---|
ulClass | String | class name for page lists, default 'pagination' |
activeClass | String | class name for active page item, default 'active' |
disableClass | String | disable class name for disabled item, default 'disabled' |
dots | String | default '...' |
hideIfEmpty | Boolean | whether to hide paging if only have one page, default true |
showPreNext | Bollean | whether show pre and next button, default true |
scrollTop | Bollean | whether scroll to top after you select one page, default false |
scrollContainer | String | which container to scroll |
adjacent | Number | the page amount before and after the current page, default 2 |
lang | 'cn' or 'en' | default 'cn' |
key | Type | Details |
---|---|---|
total | Number | the total size of what you are displaying |
size | Number | size of each page, default 1 |
size | Number | size of each page, default 1 |
callback | Function | call back for page select operation |
fieldSelector | String | the field u want to mount, exp: '.field' |
key | Type | Details |
---|---|---|
num | Number | the page num will go to |
FAQs
pagination implemented in pure JavaScript
The npm package @jemmyphan/js-pagination receives a total of 0 weekly downloads. As such, @jemmyphan/js-pagination popularity was classified as not popular.
We found that @jemmyphan/js-pagination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.