简体   繁体   中英

Jquery pagination plugin - Next/Previous pagination links to show next/previous full group of page numbers

Jquery pagination plugin - Next/Previous pagination links to show next/previous full group of page numbers

Is there a way to configure the next/previous buttons so that I can achieve the following?

For example, Pagination like

First Prev 1 2 3 4 5 Next Last

on clicking "Next" button,

First Prev 6 7 8 9 10 Next Last

Note: I am using jquery Bootpag plugin http://botmonster.com/jquery-bootpag/#example-advanced

You need to change the appropriate parameters when initializing the bootpag:

...
first: 'First',
last: 'Last',
prev: 'Prev',
next: 'Next',
...

 $('.pagination').bootpag({ total: 50, page: 2, maxVisible: 5, leaps: true, firstLastUse: true, first: 'First', last: 'Last', prev: 'Prev', next: 'Next', wrapClass: 'pagination', activeClass: 'active', disabledClass: 'disabled', nextClass: 'next', prevClass: 'prev', lastClass: 'last', firstClass: 'first' }).on("page", function(event, num){ $("#content").html("Page " + num); // or some ajax content loading... }); 
 <script src="//code.jquery.com/jquery-2.1.3.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <script src="//rawgit.com/botmonster/jquery-bootpag/master/lib/jquery.bootpag.min.js"></script> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <div class="pagination"></div> <div id="content"></div> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM