jquery-bootpag icon indicating copy to clipboard operation
jquery-bootpag copied to clipboard

Worth adding to docs that using multiple classes on prevClass and nextClass options breaks when switching between page sets

Open Coder-Dan opened this issue 7 years ago • 0 comments

So I tried adding a set of class rather than a single class to apply a css ruleset:

    $('.lib-page').bootpag({
      total: 7,
      page: 1,
      maxVisible: minimumPages,
      leaps: false,
      // For some reason, setting additional class breaks prev and next on next leap
      prevClass: 'unique-prev teal-green',
      nextClass: 'unique-next teal-red',
    }).on('page', function(event, num){
      $('.lib-page').parent().prepend('<p>Page ' + num + '</p>');
    })

But this ends up making the next and prev disappear and unable to go back to the first set of pages.

For example, on load I have this:

<< 1 2 3 4 >>

after 4 I get this:

5 6 7

I write this here as a message to other developers who end up doing the same as I did. Do not use multiple class on prevClass or nextClass as it breaks the pagination.

Coder-Dan avatar Apr 19 '19 01:04 Coder-Dan