New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

code42day-pager

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code42day-pager

simple pager optionally without numbers

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

pager

Simple pager optionally without numbers. Demo is here

Installation

Install with npm:

$ npm install -S code42day-pager

API

You need a DOM element with .pager class to create pager. See example

var pager = require('pager');
var numeric = pager(document.querySelector('.numeric')).total(5).render();

The actual content displayed by pages is CSS driven. By default the page number is displayed but you can style .active and .incactive class to display whatever you want: custom fonts, shapes, colors etc.

Pager(el)

Creates a pager as a child of el Pager is not rendered until render is called

render()

Render pager - needs to be called whenever number ot total pages changes.

total(n)

Sets number of pages to be displayed. Pages are numbered from 0 to n-1. You need ot call render to refresh the component it total changes.

select(n)

Selects n-th page - n is 0-based

Events

show

show is generated whenver user clicks on a page, its parameter is a 0-based page number

License

MIT

Keywords

browser

FAQs

Package last updated on 22 Nov 2015

Did you know?

Socket

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.

Install

Related posts