An open API service indexing awesome lists of open source software.

https://github.com/botmonster/jquery-bootpag

bootpag is a dynamic pagination jQuery plugin for Bootstrap
https://github.com/botmonster/jquery-bootpag

bootstrap bootstrap3 bootstrap4 bootstrap5 jquery-plugin pagination

Last synced: about 2 months ago
JSON representation

bootpag is a dynamic pagination jQuery plugin for Bootstrap

Awesome Lists containing this project

README

          

# bootpag

[![CI](https://github.com/botmonster/jquery-bootpag/actions/workflows/ci.yml/badge.svg)](https://github.com/botmonster/jquery-bootpag/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/bootpag)](https://www.npmjs.com/package/bootpag)
[![npm downloads](https://img.shields.io/npm/dm/bootpag)](https://www.npmjs.com/package/bootpag)
[![](https://data.jsdelivr.com/v1/package/npm/bootpag/badge?style=rounded)](https://www.jsdelivr.com/package/npm/bootpag)
[![License](https://img.shields.io/npm/l/bootpag)](https://github.com/botmonster/jquery-bootpag/blob/main/LICENSE)

Dynamic pagination [jQuery](https://jquery.com/) plugin. Works with [Bootstrap](https://getbootstrap.com/) or standalone. [Live demo](https://botmonster.com/jquery-bootpag/) online.

## Installation

```bash
npm install bootpag
```
Or use a CDN:

**CDN jsDelivr**
```html

```

**CDN unpkg**
```html

```
For older versions compatible with Bootstrap 4 or 3, see the [compatibility guide](compatibility.md).

**Manual:** Download `jquery.bootpag.min.js` from the [latest GitHub Release](https://github.com/botmonster/jquery-bootpag/releases/latest).

> **Note:** Requires jQuery >= 1.6 as a peer dependency. Make sure jQuery is loaded before bootpag.
>
## Usage

Check [live demo](https://botmonster.com/jquery-bootpag/) online or run `npm run build` and open `examples/index.html` in a browser.

HTML
```html

Dynamic page content



```
JAVASCRIPT
```javascript
$('#pagination-here').bootpag({
total: 7,
page: 1,
maxVisible: 5,
leaps: true
}).on("page", function(event, num){
// ... load content from the server and update DOM
$("#content").html("Page " + num);
});
```

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `total` | number | `0` | Total number of pages |
| `page` | number | `1` | Current active page |
| `maxVisible` | number | `total` | Maximum visible page buttons |
| `leaps` | boolean | `true` | Next/prev jump through `maxVisible` ranges |
| `href` | string | `'javascript:void(0);'` | Href template for page links |
| `hrefVariable` | string | `'{{number}}'` | Placeholder replaced with page number in `href` |
| `next` | string\|null | `'»'` | Next button text/HTML (`null` to hide) |
| `prev` | string\|null | `'«'` | Prev button text/HTML (`null` to hide) |
| `firstLastUse` | boolean | `false` | Show first/last page buttons |
| `first` | string | `''` | First button text/HTML |
| `last` | string | `''` | Last button text/HTML |
| `wrapClass` | string | `'pagination'` | CSS class for the `