1 year ago

#75366

test-img

xyz_dec

twbspagination problem in displaying next set of pages

I am new to JavaScript and I face some issue in pagination. I am working on a project and I wish to display the pages in a set of 7 and it'll go to the next set when the 'Next' is clicked. For example, 1-7, 8-14,... It works well in the first 4 pages. First Set However, when it's at page 5, the '5' is displayed in the middle and the whole thing is shifted to the left by 1. Problem starts from page 5. Also, I wish the page 8, 15,... will be at the beginning of the successive set, not at the middle.

Below is a part of the code.

Pls: I am using twbspagination plugin.

...
$('#page_navigation').removeData("twbs-pagination");
$('#page_navigation').twbsPagination({
totalPages: 32,
visiblePages: 7,
first: '',
last: '',
prev: 'Prev',
pageClass: 'page-item',
activeClass: 'active',
startPage: 1,
onPageClick: function(event, page){
  ...// navigate model to display images
 
  },
})

I greatly appreciate your kind assistance! Thank you!

javascript

jquery

pagination

0 Answers

Your Answer

Accepted video resources