Giter VIP home page Giter VIP logo

paginga's Introduction

Welcome to paginga

Paginga is just a simple jQuery Pagination Plugin.

paginga-logo

Demo

An example is available here.

Usage

Include paginga in your page:

<script src="https://cdn.rawgit.com/mrk-j/paginga/v0.8.1/paginga.jquery.min.js"></script>

Use the following markup for the items you want to paginate:

<div class="paginate 1">
  <div class="items">
    <div>Item 1</div>
    <div>Item 2</div>
    <div>Item 3</div>
    <div>Item 4</div>
    <div>Item 5</div>
  </div>
  <div class="pager">
    <div class="firstPage">&laquo;</div>
    <div class="previousPage">&lsaquo;</div>
    <div class="pageNumbers"></div>
    <div class="nextPage">&rsaquo;</div>
    <div class="lastPage">&raquo;</div>
  </div>
</div>

Call the paginate plugin:

$(".paginate").paginga({
  // use default options
});

Options

Name Type Default Description
itemsPerPage integer 3 The number of items on one page.
itemsContainer string ".items" Selector for element containing all the elements that should be paginganated.
item string "> div" Selector for elements in itemsContainer.
page integer 1 This is the initial page.
nextPage string ".nextPage" Selector for the element to bind next page action.
previousPage string ".previousPage" Selector for the element to bind previous page action.
firstPage string ".firstPage" Selector for the element to bind first page action.
lastPage string ".lastPage" Selector for the element to bind last page action.
pageNumbers string ".pageNumbers" Selector for the element the page numbers are placed in.
maxPageNumbers integer or false false If set to an integer the maximum of visible pages in the .pageNumbers element is equal to this setting.
currentPageClass string "active" Class name for the active page anchor in pageNumbers element.
pager string ".pager" Selector for element that contains all pagination anchors. This element is hidden when autoHidePager is set to true and there is only one page.
autoHidePager boolean true If set true the pager element is set to hidden if there is only one page.
scrollToTop object or false { offset: 15, speed: 100 } If not set false the first element on the page will be scrolled into the viewport on paginate.
history boolean false If set true, paginga will automatically keep track of the user going through the pages and add a numeric hash to the URL. This way the user can use the back button to go to the previous page. This also works when the user has visited an external website. The browser must support history management.
historyHashPrefix string "page-" With this parameter you can set the prefix for the history hash. If you are using multiple paginga instances on one page you need to alter this setting for each instance to ensure the history will work properly and independently for all instances.

paginga's People

Contributors

mrk-j avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.