Skip to content

A simple JQuery plugin to provide paging functionality for data driven web applications.

Notifications You must be signed in to change notification settings

fabianbuch/jquery-pager-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

/*
* jQuery pager plugin
* Version 2.0 (03/21/2012)
* @requires jQuery v1.2.6 or later
*
* Copyright (c) 2008-2009 Jon Paul Davies
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* 
* Read the related blog post and contact the author at http://www.j-dee.com/2008/12/22/jquery-pager-plugin/
*
* This version is far from perfect, therefore contributions are more than welcome!
*
* Usage: .pager({ pagenumber: 1, pagecount: 15, buttonClickCallback: PagerClickTest });
*
* Where pagenumber is the visible page number
*       pagecount is the total number of pages to display
*       buttonClickCallback is the method to fire when a pager button is clicked.
*
* buttonClickCallback signiture is PagerClickTest = function(pageclickednumber, previousPage) 
* Where pageclickednumber is the number of the page clicked in the control.
*
* The included Pager.CSS file is a dependancy but can obviously tweaked to your wishes
* Tested in IE6 IE7 Firefox & Safari. Any browser strangeness, please report.
*
* Extended Usage:
*        .pager({
*           pagenumber: 1,                          // current page
*           pagecount: 50,                          // overall pages available
*           show_first_and_last: false,             // turn on or off 'first' and 'last'-buttons
*           number_of_pages: 7,                     // number pages shown at once
*           min_page_digits: 1,                     // 2 will prepend a '0' for page numbers < 10, e. g. '01' intead of '1'
*           buttonClickCallback: PageClickFunction, // the callback function that is called when clicked on a button or page
*           button_label_first: 'First',            // button labels can be set
*           button_label_last: 'Last',
*           button_label_prev: '&lt;&nbsp;Back',
*           button_label_next: 'Next&nbsp;&gt;',
*           page_separator: '|'
*        });
*
* The following public methods are also available:
*    setCurrentPage - takes one argument, the page to go to.
*    currentPage    - takes no arguments, returns the current page.
*
* Example:
*      $('#yourpager').pager({ pagecount: 10 });   // Initialize it
*      $('#yourpager').pager('setCurrentPage', 3); // go to page 3.
*      $('#yourpager').pager('currentPage);        // returns 3
*/

About

A simple JQuery plugin to provide paging functionality for data driven web applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%