Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6350783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:52:40+00:00 2026-05-24T21:52:40+00:00

I am building a pagination plugin and I am having the strangest results. here

  • 0

I am building a pagination plugin and I am having the strangest results.
here is a demo

If you click on the next button (>>) you will be taken to the last page.
But, if you click on the prev button (<<) before you click on the next button you will be taken to the proper page.

Ohh, and if you click on a page number then the next button you will always be taken to the last page.

I’ve been staring at it for a bit now. boggles me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:52:40+00:00Added an answer on May 24, 2026 at 9:52 pm

    It’s because this line return a string:

     var _to = $(this).attr("id");
    

    So that string eventually makes it’s way into current_to and when you write current_to + $options.items_pp you get a string like 1010 instead of 20.

    Just change the line to:

    var _to = parseInt($(this).attr("id"), 10);
    

    Or even better:

    var _to = parseInt(this.id, 10);
    

    JSFiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a string via the following: pagination +='<li>''<a href=/main/?page=%(current_link)s'+link+'>%(current)s</a></li>' % \ {'current_link': current_link,
I am building a php site using jquery and the DataTables plugin. My page
I'm building a little pagination with jquery. I found a plugin that does some
Building an iPhone OS application that will allow users to anonymously post information to
I'm building a site that is a portfolio of projects. I have some pagination
The page I am building should display a list of items. Let's say these
Building a site super quick and having it work on all my Mac browsers,
We're building an internal web app used by about 50 users. Our users will
I want to customize next/previous posts links pagination to this structure: <!--PAGINATION--> <a href=#prev_post_link#
building on my last question jQuery getting values from multiple selects together I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.