The Silver Lining

Lessons & Learnings from a salesforce certified technical architect.

Pajinate – A jQuery Pagination Plugin

with 234 comments

Pajinate is a simple and flexible jQuery plugin that allows you to divide long lists or areas of content into multiple separate pages. Not only is it a simpler alternative to server-side implementations, the time between paginated-page loads is almost nil (up to a reasonable page-size of course).

Pajinate - A pagination plugin the whole family can enjoy!

Usage & Configuration

All plugin documentation can now be found on github.

Demo

Multiple implementation demos can be found in this page.

Source Code

The Pajinate source and examples are available here.

Github

If you’re keen to contribute to this project, or perhaps take it in a different direction you can get ahold of the source here:

http://github.com/wesnolte/Pajinate

The demo and source offer several examples demonstrating various ways in which to configure and use Pajinate (including embedding multiple Pajinate elements in a single page).

Written by Wes

April 15, 2010 at 8:48 pm

234 Responses

Subscribe to comments with RSS.

  1. Hi Wes,

    I am nurse by trade (you’d never say) but have been working as a sfdc partner consultant for 5 years now. Most of what I know I was taught by guys like you.. on the net through posts and of course the community forums. So i have only started to learn Apex recently and of course is now trying to make sense of javascript and HTML too.

    Enough of that – how and where would I be able to use this in SFDC if at all?

    Soory for the *dumb* question, but if I dont ask I’ll never know!
    Thanks

    Charly

    Charly

    April 15, 2010 at 9:07 pm

    • Not a silly question at all, I anticipated it but didn’t want to sully the post. This post – as it stands – has nothing to do with Salesforce, and is purely a jQuery plugin I’ve created; although the ideas stems from something I need in Force.com App I’m working on. I’ll do a follow-up post to this which will detail a Salesforce-specific implementation.. that is, if I’m not beaten to it 😉

      How’s the South African appetite for Salesforce at the moment?

      Wes

      April 15, 2010 at 9:19 pm

  2. Nice…..BUT, I had to add some pizazz. I couldn’t resist. 😉

    http://tehnrd.com/pajination/example1.html

    Jason

    April 15, 2010 at 9:30 pm

  3. […] original here: Pajination – A jQuery Pagination Plugin « The Silver Lining If you enjoyed this article please consider sharing […]

  4. Pretty

    d3developer

    April 16, 2010 at 3:16 am

  5. […] I’m using to create this pagination is a jQuery plugin I’ve created and cheesely called Pajinate. I’ve written an article on how to implement the plugin for general HTML development, but […]

  6. […] Pajinate is a simple jQuery plugin that allows you to divide long lists or areas of content into separate pages. It provides an easy alternative to server-side implementations, when the amount of data is of reasonable size; another good thing is that there is no load-time between pages. […]

  7. […] the original here: Pajinate – A jQuery Pagination Plugin « The Silver Lining 2 May 2010 | Uncategorized | Trackback | del.icio.us | Stumble it! | View Count : 0 Next Post : […]

  8. […] Pajinate – A jQuery Pagination Plugin « The Silver Lining (tags: jquery pagination page) […]

  9. […] Pajinate is a jQuery plugin that can auto-generate a paginated navigation for list items or any other areas of content. […]

  10. […] Pajinate ist ein jQuery Plugin um lange Listen in Seiten zu unterteilen. […]

  11. […] a lot of tinkering around to make them work properly and, of course, some just plain stupid. “Pajinate” it’s not like the others and I’m not getting paid to say that, although I wish I […]

  12. […] Pajinate is a jQuery plugin that can auto-generate a paginated navigation for list items or any other areas of content.The plugin is specially handy when working with long lists in a limited space (but still require a quick navigation).The pagination menu generated has the first-last, prev-next and the page numbers and the text for them can be customized.It is also possible to set the: […]

  13. […] updates on this topic.Powered by WP Greet Box WordPress Plugin Powered by Max Banner Ads Pajinate is a jQuery plugin that can auto-generate a paginated navigation for list items or any other areas […]

  14. […] Pajinate is a jQuery plugin that can auto-generate a paginated navigation for list items or any other areas of content. […]

  15. […] the time between paginated-page loads is almost nil (up to a reasonable page-size of course). Download […]

  16. […] Pajinate is a jQuery plugin that can auto-generate a paginated navigation for list items or any other areas of content. […]

  17. […] ello. Además siempre esta bien que se pueda navegar por estas listas de forma simple y rápida. Pajinate es un plugin para jQuery que autogenera una lista de elementos con navegación por páginas, o para […]

  18. I’d really like to be able to use this on my company’s intranet site.

    What’s happening on the page is that we’re already paginating the items using another JavaScript function, and I’m just looking to be able to do something with the page numbers so we don’t have 30+page links on the page. As it is, the page isn’t refreshed, and I haven’t been able to find another script that doesn’t deal with changing the page numbers or refreshing the page. (Maybe my Google-fu is weak.)

    Amanda

    May 17, 2010 at 5:04 pm

    • Hello 🙂

      You can configure the number of page links that are shown with Pajinate, and the page doesn’t refresh for each new page. Is that what you’re looking for?

      Wes

      May 17, 2010 at 7:05 pm

      • That’s totally what I’m looking for, but I don’t need the part of the code that deals with the content. I just need to deal with the page numbers, because each page link deals with the content. Do you have to specify a content section, or is there a work around for that?

        Thanks! 🙂

        Amanda

        May 17, 2010 at 7:22 pm

  19. […] Info & Download | Demo Share […]

  20. […] Pajinate – jQuery Plugin by Wes Nolte […]

  21. […] 「Pajinate」は長いコンテンツやリスト要素を自動的にページングを表示してくれるjQueryのプラグインです。 […]

  22. Hello Wes,

    I love the Pajinate plugin, however is there anyway to adapt it to recognize HTML tables?

    I want to page a long single table full of rows and columns. It doesn’t work if I put it class=”content” in the tag…

    Hope you can help me out!

    Fritz

    May 24, 2010 at 10:33 am

    • Thanks Fritz. Yes you can, I’ve posted a bit of sample code at http://pastebin.com/npNgcpTU. There’s an example here too.

      Wes

      May 24, 2010 at 12:37 pm

      • Thank you so much Wes!

        Would you say this would solve any buffer issues with regards to large amounts of data?

        More power to you!

        Fritz

        May 24, 2010 at 1:21 pm

      • I tried adding this code for a table, but i’m not getting the actual numbers.

        Example:

        First | Prev | … | … | Next | Last

        Clicking next and previous does go through the pages, but the numbers aren’t showing.

        Any ideas?

        Ricky

        March 31, 2011 at 1:36 am

      • Can you link out to your code so I can have a look?

        Wes

        March 31, 2011 at 9:16 am

      • Thank you very much… old but still good (Y)

        Roberto Valdez

        September 20, 2013 at 3:42 am

    • I’m not sure about the buffer issues, I’m still discovering the sweet spot in terms of data size with Pajinate..

      Wes

      May 24, 2010 at 1:26 pm

  23. Alright! Thanks again! 😀

    Fritz

    May 24, 2010 at 1:34 pm

  24. […] Pajinate è un semplice plugin di jquery utile per creare la paginazione partendo da un elenco puntato o da un qualsiasi listato di dati. Il menù della paginazione, che viene generato, presenta i tasti first-last per passare dalla prima pagina all’ultima, prev-next per scorrere le pagine singolarmente e ovviamente i numeri di ogni pagina.Questi tasti possono essere comunque personalizzati inserendo la dicitura che più ci aggrada.Grazie a questa paginazione processata lato browser otterrete anche dei vantaggi in termini di prestazioni e navigabilità della pagina in quanto molto meno onerosa in termini di banda e di performance rispetto alla classica versione realizzata lato server. […]

  25. First, fantastic plugin! One thing I’m trying to do is set the items_per_page dynamically based on a click handler. For instance if I have 100 items and want to initially show 20 per page but also allow someone to click a link to View All. Clicking that link would set the options.items_per_page to 100.

    Any ideas how I could accomplish this?

    Jason

    June 9, 2010 at 4:15 am

    • Sorry for the delayed response, been a little busy 😉 I haven’t had time to build that in just yet (an excellent feature though), so for now you’d need to reload the plugin. You could do this with a click handler on a button, but be careful if your lists are large, there’ll be some latency.

      Wes

      June 10, 2010 at 12:19 pm

  26. This plugin is awesome! Thank you for sharing.
    I was wondering if we can add fading effect to it. Is it possible to make the current page fade out and the next page fade in when clicking the pagination links? I don’t know much about jQuery, so I have no idea if it is possible or not.
    Also, wondering if I can use the plugin in a commercial website.
    Thanks.

    Cemile Bora

    June 12, 2010 at 2:15 pm

    • Thanks for the kudos. Fading is indeed possible, just google “jquery transition effects”. jQuery is very easy, so it’ll be simple to add this feature to the plugin. The plugin is publish under the MIT license so you can use it where ever you like. The only real rule is regarding the copyright notice inside the plugin: “The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.”.

      If you look through the comments you’ll see one by TehNrd(Jason). He’s added in a transition effect which – together with the fade transition effect – should help you get started.

      Wes

      June 12, 2010 at 3:04 pm

      • I managed to add the fading effect with the help of Jason’s version. Again thank you for creating such a great plugin.

        Cemile Bora

        June 12, 2010 at 8:04 pm

  27. Great plugin. Would there be an easy way to toggle pagination on and off? I was thinking a simple (dumb) method might be to dynamically adjust the items_per_page to a really large number. I’m working with relatively small recordsets, so this would be viable for my scenario. Maybe you have a better idea or better yet, a code example.

    k-factor

    June 21, 2010 at 11:42 pm

    • Do you mean remove the navigation etc. if there’s only one page of information?

      Wes

      June 22, 2010 at 4:47 pm

      • Not exactly. I just mean a toggle between a full long unpaginated list (one page), and the paginated version. For instance if someone wanted to print out all records, or copy/paste into Excel, it would be handy to toggle pagination off, but still be able to toggle it back on.

        k-factor

        June 22, 2010 at 4:58 pm

  28. […] von Rilana Vielen Dank Leute… so nett dass ihr mir versucht zu helfen! Habs inzwischen mit Pajinate – A jQuery Pagination Plugin ja aus diesem grund liebe ich jQuery ist gibt für das alles plugins __________________ Mein […]

    paging - php.de

    July 2, 2010 at 11:58 am

  29. Hi, cool plugin. I’m trying to use it, but I have a problem.

    I want to store into a cookie, the current page that I was looking before unloading the current html.

    How I can I get the value of the active page?

    I have a click handler ready, but I have an undefined error the the current_page variable.

    Thanks for your help!!

    Martin

    July 8, 2010 at 12:34 pm

    • There are a few options available, but some would need you to rework a small piece of the plugin:

      1. You could use jQuery to run through the navigation panel and find the active page (this is how the plugin does it and it quickest).
      2. You could change the plugin to persist that information using .data(). But you’d also have to maintain it which would make the code a bit dirty.
      3. You could create a plugin method that returns the active page number.

      Feel free to grab the source from github and play with it. You can also experiment in realtime with jsFiddle: http://jsfiddle.net/pzsv2/

      Wes

      July 8, 2010 at 1:38 pm

  30. Is it possible to get the code for the fading transition effect? I just can’t seem to figure out where to add it. This really is an ace plugin!!!!

    Michael Story

    July 13, 2010 at 10:16 pm

    • Hmmm, I’m a bit swamped at the moment but did you have a look here: http://tehnrd.com/pajination/example1.html. You’ll need to modify the transition effect to fade instead of… well whatever that’s called. Perhaps use that with the advice I gave ‘Cemile Bora’ higher up the page? Or maybe you can get in touch with her (I don’t have the deets but some stalking should help).

      Wes

      July 14, 2010 at 12:38 pm

  31. you are great!!. I love your work.you are one of the finest jquery plugin developer

    manish

    July 14, 2010 at 7:54 am

    • lil ol’ me?! Thanks for your kind words 🙂

      Wes

      July 14, 2010 at 12:33 pm

  32. […] 2. Pajinate – A Pagination Plugins […]

  33. […] 8. Pajinate […]

  34. For a better eye effect just change line 179 in jquery.pajinate.js from show(); to fadeIn();

    Webrunner

    August 9, 2010 at 2:13 pm

  35. Hi Wes!

    Thanks so much for creating this simple and light plugin. It’s great!

    I’m actually curious if I can remotely call the goto() function — specifically ‘on page load’. I’m creating Unique URL’s for each of my pages that are created from pajinate(), so that people can share a specific page of paginated results. I’ve figured out how to create the URL’s, and now need to figure out how to call the goto() function on page load.

    I’ve created a question on Stack Overflow » http://stackoverflow.com/questions/3442581/jquery-pajinate-js-calling-goto-externally-manually.

    Maybe you could help me solve this issue?

    MUCH Thanks!

    Mike B.

    August 9, 2010 at 9:44 pm

    • Hi Mike, I answered your stack overflow question.. it should be quite simple given the work you’ve already done. Cheers!

      Wes

      August 10, 2010 at 4:30 pm

  36. Hi there

    Is there any way you could add history on your pagination? So browser back button works?

    Is it possible to use your pagination with loading a contents dynamically using jquery load() method instead of having allready on a page (I have a LARGE set of 10000 items) ;-(

    Yours

    Jerry

    Jerry2

    August 23, 2010 at 10:40 am

    • I like your load() suggestion, I will add it in but not for a while I’m afraid.. too much on my plate!

      Wes

      August 23, 2010 at 10:49 am

  37. Ok, I understand. EIf you manage to add history support it will be the first pagination with such support that I know of 😉

    Jerry2

    August 23, 2010 at 10:56 am

  38. […] Pajinate […]

  39. […] Pajinate […]

  40. […] Pajinate […]

  41. hi

    i am very new to jquery and was wondering is there a way that when the user click on any of the buttons if returns them to the top of the page, as i have around 50 elements on each pages and it stays at the bottom of the page each time.

    jamie

    August 26, 2010 at 1:38 pm

    • Hi. I am not a professional coder but I found a solution that works for me. Open your jquery.pajinate,js file. Find the following functions within the file:
      $page_container.find(‘.first_link’).click(function(e){ });
      $page_container.find(‘.last_link’).click(function(e){ });
      $page_container.find(‘.previous_link’).click(function(e){ });
      $page_container.find(‘.next_link’).click(function(e){ };
      $page_container.find(‘.page_link’).click(function(e){ });

      And within their curly brackets { } add $(“html”).scrollTop(0);

      So it will look like this
      $page_container.find(‘.first_link’).click(function(e){ $(“html”).scrollTop(0); });

      Hope this helps!

      tsmulugeta

      December 16, 2012 at 7:09 am

  42. […] Unlimited Levels Vertical Drop-Down Navigation Menu Download & Docs → Demo →PajinatePajinate is a simple and flexible jQuery plugin that allows you to divide long lists or areas of […]

  43. Wes – This is great! I’m playing around with this and have a question. The items in my list have a “view detail” link which (basically) hides the content div and displays a detail div for the selected item. Included in the detail is a “return to list” link. Wondering if there is an easy way to navigate back to the page displayed when clicked. As is, I’m calling the pajinate function when I rerender the content div. and know I can set the start_page — so is there a way to set the start_page to what was the current_page? Make sense? Still trying to get a handle on Jquery, so apologies if this is a dumb question!

    Christian

    August 27, 2010 at 4:05 pm

  44. […] Documentation Documentation Page […]

  45. Thanks a lot, great plugin, saved me a lot of time and works beautifully.

    A possible improvement might be a switch to hide pagination in case there are no results / or one page only but that’s just a detail.

    Take care,
    Jan

    Jan

    September 16, 2010 at 2:37 pm

  46. hi how to get the current page li values in your script.

    james

    November 2, 2010 at 7:38 pm

  47. Hey there!

    pajinate is a great plugin for jquery. thanx a lot. I have one question about. I’ve combined your pajinate with a selectable from the jqueryui lib. When i now try to select items from the pajinated list… my browsers slows down as hell. Do you have any ideas or solutions to this problem?

    thanx in advance.

    peter

    November 9, 2010 at 10:52 am

    • Unfortunately I can’t help you directly, but your browser can 🙂 Use Firebug for FF or Developer Tools for Chrome/Safari (both are built in) and monitor the resources and JS consoles.

      Wes

      November 9, 2010 at 11:08 am

  48. Hi,

    Can I ask is this a wordpress plugin or can it be used on any site, also would this work with server side code as well such as getting results back from a database ?

    Thanks

    James

    November 11, 2010 at 1:51 pm

    • It’s a plugin for any HTML page. You can use any server side code to generate dynamic pages, and the plugin can paginate the resultant elements.

      Wes

      November 11, 2010 at 2:55 pm

  49. […] Pajinate […]

  50. Hi it is possible to make the pagination rotate every 10 seconds?

    James

    December 2, 2010 at 7:00 pm

  51. hello,
    nice and very useful plugin, one question: how can i hide the navigation menu if there’s only one page of data?
    thanks, nice work!
    Seb

    Tulum

    December 18, 2010 at 7:37 pm

    • for those interested in the above i’ve added a quick and dirty way of doing this:

      find: var total_items = $item_container.(children).size(); (line 48)

      add this line after that: if(total_items>options.items_per_page){

      then find: toggleMoreLess(); (line 140)

      and add after: }

      that’s all
      i’m sure Wes can give us all a better way but this works

      Tulum

      December 18, 2010 at 8:06 pm

  52. Hi, is there a way to disable the previous button if you’re on the first page, and also disable the next button if you’re on the last page?

    Brandon

    January 5, 2011 at 10:48 pm

    • Yip but you’d have to use some bespoke jQuery to do it. Have a look at the plugin code, and the generated HTML. You can either modify the source code, or just work on top of it.

      Wes

      January 6, 2011 at 10:05 am

      • I’m pretty new to jquery so if you could point me in the right direction, that would be awesome. Thanks in advance for any help you could give me.

        Brandon

        January 26, 2011 at 7:37 am

      • Hi!

        This works so well! I’m so happy right now, you have no idea! :DDD
        I would also be grateful for a guide or just a hint, on how to disable/hide the previous button if you’re on the first page!

        Thank you so much for creating and sharing this plugin! 😀

        //Victoria

        Victoria Wagman

        June 25, 2011 at 11:51 pm

  53. Thanks a lot for this plugin! Its exactly what I wanted.

    Kartik Rao

    January 12, 2011 at 10:11 am

  54. Love the plugin. Any ideas why it would stop working once the div elements to be paginated are dynamically removed and then re-added to the DOM?

    Jeff

    January 12, 2011 at 4:05 pm

    • Pajinate will be loaded at your discretion and then builds the pagination DOM elements into the page; it’s at this time that things such as the number of pages are determined. Removing (and/or adding) elements after load will break the navigation in it’s current incarnation. You have two choices to achieve your goal: 1. Reload the plugin when altering the list of pagination elements or fork the project on github and make it smarter 🙂 If you’re going to choose option 2 I’d suggest creating a “reload” method that would recalculate all the important stuff (no. of pages etc.) whenever called. Good luck!

      Wes

      January 12, 2011 at 9:56 pm

    • Anything ever come of this? I’m looking at doing the same type of thing

      Dave Chenell

      July 20, 2011 at 6:43 pm

      • Yeah I answered the question just above BUT it looks like someone has forked my project on Github recently allowing you to load data into the list using AJAX. You can check out the fork from here: http://github.com/wesnolte/Pajinate

        Wes

        July 20, 2011 at 7:26 pm

  55. i like pajinate and it works for me,
    but is there any way to add “show all” function
    to display all items?

    rw

    January 19, 2011 at 5:53 pm

    • Alas alack there is not yet, but that is a might fine idea. I’ve been writing a book for months, but now I’ll hopefully have some time to integrate some of the good ideas I’ve received 🙂

      Wes

      January 19, 2011 at 8:45 pm

      • Hi, has the “Show All” function been implemented yet? If anything, can I get an idea of what I need to do to accomplish this?

        devblogmarkammay

        April 12, 2012 at 5:24 pm

      • Hi Wes, actually I think I have a solution (at least for my situation). I just made an on click function that shows all the li’s.
        jQuery('.alt_content li').show();

        Does that sound reasonable?

        devblogmarkammay

        April 12, 2012 at 5:41 pm

  56. Hi .. it’s Awesome work

    I have installed your plugin in my web page . I am having 5 item in ‘content’ div, but i am only getting FirstPrev……NextLast this but in page source

    FirstPrev

    1
    2
    3
    Next
    Last

    i’ve noticed style=”display: none;” in ‘a’ tag.. how to display numbers please help me !

    gowri

    January 25, 2011 at 1:57 pm

  57. Have a look in the “Configuration” section of this post. The default is 20 items per page so you’d need more than that to see any page numbers.

    Wes

    January 25, 2011 at 2:38 pm

    • Thanks for response wes,

      Yes, I noticed that default configuration.But my config is given bellow
      $(‘#paging_container’).pajinate({ num_page_links_to_display :3,
      items_per_page : 2
      });

      i can get 2 items per page, but page number still not working any idea .. i’ve installed this plugin in following link
      http://optisolbusiness.com/gonzobidz/

      gowri

      January 26, 2011 at 5:33 am

      • There seem to be several things wrong. As a learning exercise I think you should troubleshoot it. I’ll give you hints though:

        – Check that you’re using the required element IDs
        – Check that you’re using the required HTML markup, and that it’s in the right place.

        Wes

        January 26, 2011 at 7:54 pm

  58. Thanks very helped

    Andrew Ageyev

    February 9, 2011 at 7:25 pm

  59. Hy. Thnaks a lot! very nice job!

    Adtrian

    February 10, 2011 at 12:12 am

  60. Hi Wes

    Great Plugin! So much easier to implement than the others out there.

    One issue… I’m trying to implement vers’ion #paging_container7 on your example page (“Show Subset of Page Links”). On the initial state (before clicking a page) it’s showing a leading … (ellipsis). When clicking on a page number, or next button then go back to page one the ellipsis disappears. I would like to remove the ellipsis on initial load, like in your example. I can’t work out why its doing this??

    Also, those three dots are a punctuation mark called an ‘ellipsis’. An ‘ellipse’ is a geometric shape much like an oval.

    http://en.wikipedia.org/wiki/Ellipsis

    Jonny

    February 15, 2011 at 4:41 pm

    • Thanks Jonny. Great catch on the spelling, I think it might’ve been some mutant child of “ellipses” and “eclipse” 🙂

      The ellipses indicate that there are more page numbers than are currently shown e.g. you have 10 pages but have elected to only show 5 at a time. In the example you’ve cited the plug-in is told to start at a specific page, is this your situation too? Perhaps you can link to a page so that I can see exactly what you’re doing?

      Wes

      February 15, 2011 at 4:56 pm

      • Hi, I have the same exact problem: 5 pages, showing just 3 of them, and when loading the ellipses are shown at both sides, right (which is correct) and left (which is wrong!).
        After I change page, everything works as expected, the ellipses are shown at right if I load page 2, at both sides if I load page 3, and only at left if I load page 4, and obviously only at right when I load page 1.
        The problem is present ONLY at the first load.
        I’m using jQuery 1.7.1 and Firefox 9.
        It seems that the check on condition at line number 251 of the plugin fails, it always “show” the children in mine case, I can’t understand why because after I change the page it works as expected.

        emas

        January 11, 2012 at 2:24 pm

    • A quick fix is to comment the following lines from the plugin file:

      navigation_html += less;

      navigation_html += more;

      Chuck Norris

      July 26, 2012 at 7:12 pm

  61. Hi Wes! Great work indeed!

    I plan to implement it with huge data sets but I want to set up the current page to show in the middle e.g. if you have let’s say 50 pages and you set num_page_links_to_display to 10, and then if you are somewhere into that range( e.g. 4-13) the current page(8) to be always the 5th one, so to have 4 links before 5 links after that. Is that make any sense? Any tip would be helpful.
    Thank you in advance.

    Slav

    February 22, 2011 at 12:11 am

    • Hi Slav, I think you’re saying that you want the current page number to sit in the middle? This is a good idea but it’s not part of the plug-in at the moment. If I’ve misunderstood though just let me know.

      Wes

      February 22, 2011 at 12:30 pm

  62. Hi Wes, I love how simple it is to initiate the plugin and get pagination going. I’m wondering if it might be simple to add some kind of filtering to this? i’d like to be able to keep all content in the container and somehow just be able to ignore the content set to not be shown by a filter. Once a use click on a filter type maybe it can update the pagination to reflect the filter without a page reload.

    Chad

    February 23, 2011 at 6:52 pm

    • Chad, that’s an excellent idea but it’s not available yet. I’m looking forward to getting v2 this year and this suggestion is definitely going into the mix!

      Wes

      February 24, 2011 at 6:11 pm

  63. […] "pub-3165506645002435";google_ad_slot = "3433820016";google_ad_width = 336;google_ad_height = 280; Pajinate is a simple and flexible jQuery plugin that allows you to divide long lists or areas of content […]

  64. Hi there. I’m expecting many pages to be returned in my search results.

    Let’s say there are 30 pages returned, showing 5 at a time. Can it be made that when the next button is clicked, pages 1-5 change to 6-10, then 11-15 etc.. instead of moving 1 page at a time? Same for previous, if currently viewing the 6-10 page set, prev would show pages 1-5.

    Clicking the numbers themeselves would still take you to that specific result set

    Any ideas? thanks!!

    David

    April 8, 2011 at 12:42 am

  65. […] Pajinate […]

  66. Is possible to combine this plugin with this example?

    http://www.danieltulp.nl/work/quicksand-multiple.htm for dowload example here!

    http://forum.jquery.com/topic/quicksand-plugin-using-multiple-filters

    I need help, to combine!!

    Thanks

    Takehiko

    April 20, 2011 at 11:13 am

  67. […] Pajinate Je vous en parle ici Insérez la pagination via jQuery sur votre site internet. Le site […]

  68. Thanks for the excellent plugin. I have already deployed it on a web site that I will be publishing soon. Awesome.

    I have one question: (How) Is it possible to get the page to scroll to an HTML anchor (, after one of the num_page_links has been clicked?

    This is required, in the case that the top of the list that you are paginating has scrolled off the top of the page.

    Thanks in advance.

    Richard

    May 6, 2011 at 2:23 pm

  69. Great plugin, just what I was looking for. Thank you!

    Alex

    May 18, 2011 at 12:50 am

  70. I’m using this plugin on a page of my site, but i was wondering how i would make this jump to the top of the page once a pagination link had been clicked.

    At the moment, i have the navigation at the top and bottom of the content, whenever you use the bottom navigation links, it stays at the bottom of the page which isn’t ideal.

    David Perkins

    May 28, 2011 at 1:48 pm

  71. I feel like I’m missing something huge here. I’m new to java script and jQuery so I can read your plugin but I’m not 100% on every aspect about it.

    What I’m trying to do is re-position the pagination navigation and fix it so people can click around my posts but still scroll, but when I use position: fixed; in css (or any css positioning) it either breaks the nav bar or does nothing to it. I’m assuming this has something to do with how these numbers are generated in the plugin. Any thoughts (even “sorry dude, that’s how this works”) would be super helpful.

    Great plugin by the way, and super easy to impliment. Can’t wait to get it working on my main site which feels like it’s pretty close to completion.

    b-train

    May 30, 2011 at 6:23 pm

    • I can’t be sure what’s going wrong since CSS cascades – it could be a number of things. As long as your HTML markup fits the plugin specification you should be good to go… the other bit you’ll need is knowledge of CSS positioning and the best article on the internet for that is here: http://www.barelyfitz.com/screencast/html-training/css/positioning/

      Wes

      May 30, 2011 at 7:56 pm

      • cool, I’ll try that out. Perhaps it’s a sign I have some code cleaning to do.

        Thanks for the speedy resposne! 🙂

        b-train

        May 30, 2011 at 8:47 pm

  72. Awesome! Awesome! Awesome! Just what I needed. Super simple to implement. Huge thanks.

    Dejon

    June 2, 2011 at 7:45 am

  73. Hello! Help me please, I use Pajinate on this page: http://hooche.ru/pechi , but I have some problem on the second page, div class=”news” is missing background and color.. Why? )) Thank you!

    Dan

    June 15, 2011 at 1:38 pm

  74. mm.. I’m sorry.. in IE8! but its a problem for me ))

    Dan

    June 15, 2011 at 2:17 pm

  75. […] Download jQuery Pajinate paginator […]

  76. […] Is a simple and flexible jQuery plugin that allows you to divide long lists or areas of content into multiple separate pages. Source […]

  77. First of all, thank you for this excellent plugin! Secondly, I want to keep the tap (or click) behavior on the iphone and ipad, so that when I double tap a paragraph or image it zooms in, and out when I double tap again.

    Can this be done with this plugin and could you send me in the right direction on how to do it?

    My current implementation is on http://www.marcbuurke.nl/portfolio.php If you want I can send you the current plugin code, I modified it a bit and optimized it for loading.

    Marc Buurke

    October 7, 2011 at 11:40 am

    • Ek hou baie van jou site!

      What problem are you experiencing on the mobile side? I’m guessing a double tap fires the plugin event handler? I’m not sure how you could fix this but I’d start by looking at jquery mobile. I would love to see your optimised code. Do you have a github account? That way you could just fork my code and issue a pull request – makes it easy for me to see the differences.

      Wes

      October 7, 2011 at 11:47 am

      • I’ve learned a lot since I used this rad plugin, and this plugin really is still rad.. But if you guys wanna have special functionality for iOS devices, I found this handy little piece of code that uses a regex to tease out the OS type. I think it might be what you’re looking for. I have a site right now that uses flash (argh I know, but it’s unavoidable… html 5 and browsers natively supporting websockets will help ween me off of that dependency) so I needed a way to have a special message for people on iOS devices. My thought is you can have a switch at the first layer of your function that does one thing for iOS devices and one thing for non iOS devices. here’s the link

        http://www.sitepoint.com/identify-apple-iphone-ipod-ipad-visitors/

        and here’s the code:
        var Apple = {};
        Apple.UA = navigator.userAgent;
        Apple.Device = false;
        Apple.Types = [“iPhone”, “iPod”, “iPad”];
        for (var d = 0; d < Apple.Types.length; d++) {
        var t = Apple.Types[d];
        Apple[t] = !!Apple.UA.match(new RegExp(t, "i"));
        Apple.Device = Apple.Device || Apple[t];
        }

        brainTrain

        October 22, 2011 at 3:13 pm

  78. Superb.
    thanks a lot

    Satheesh

    October 22, 2011 at 8:57 am

  79. Having a strange issue, hopefully someone will see this and respond soon.

    I am trying to use Pajination on search results (using jQuery Mobile, PHP and mySQL), and it is working. But not completely. When I initially type in my search string, and hit “search” the results page comes up as one long list. When I hit “refresh” on that page, it is paginated correctly.

    Does anyone have any idea what could cause this?

    Thanks in advance!

    Brian Rust

    December 8, 2011 at 9:30 am

    • If you post a link to the page I’ll try get some time to have a look 🙂

      Wes

      December 8, 2011 at 3:25 pm

      • the page is a personal site, and i don’t really feel comfortable posting a link on an open message board. but if you will e-mail me, i’ll send you the link. bmrust (at) gmail (dot) com

        thanks!

        Brian Rust

        December 8, 2011 at 9:54 pm

    • I am having this same issue. What is the fix to this?

      I’m creating an app and using phone gap and jQuery mobile. Pajinate works only if I refresh, and doing this I lose the back button in mobile browsing. How can I fix this?

  80. Hi there, I have following HTML Structure:

    foo
    boo

    ….

    then 200 , end everything closed correctly.

    I’m calling the function with:

    $(document).ready(function(){
    $(‘#pagination_content’).pajinate();
    });

    Is it because it is sub div within 2 classes ? can this somehow be set to work ?

    And as a question, I changed my code so every of my 200 articles is now , but I used to have articles within tags, can sub-dives be paginated somehow with minor modifications in your script ?

    balkyto

    January 13, 2012 at 12:30 pm

    • Uh, My HTML structure is not posted ? … you can mail me and I can mail you HTML back. TX.

      balkyto

      January 13, 2012 at 12:32 pm

      • Hey. Do you have a link to the page you’re working with? That way I can see the source in action.

        Wes

        January 15, 2012 at 2:00 pm

      • Nope, it’s not up und running yet, locally on my machine…

        balkyto

        January 16, 2012 at 8:53 am

  81. Hi Wes, was wondering if the value for the items_per_page was accessible via the dom? Also, is there a variable for the current page in the pajinator?

    I have a google map showing markers for results returned, but dont know where to look for the starting item number, and the number of items in the current pagination list.

    If there is documentation which spells this out, just let me know what the link is. Thanks.

    Brett

    January 15, 2012 at 2:52 pm

    • Hi Brett, unfortunately the functionality you’re talking about doesn’t currently exist. I wrote this plugin waaaay back in the day and the things you’re asking for probably should’ve been there from the beginning. You live you learn 🙂

      That said the way to do this is outlined in this article under “Provide public access to default plugin settings”. I don’t think I’ll have time to add this in in the short-term but I’d be happy to accept any pull requests 😉

      Wes

      January 17, 2012 at 4:19 pm

      • Thanks Wes, I’ll review the article

        Brett

        January 17, 2012 at 4:31 pm

    • Actually, I’ve used HTML5 sessionStorage to retreive the current page. Use sessionStorage.setItem(‘curPage’,page_num); added to jquery.pajinate.js in function gotopage() (just before toggleMoreLess();) and it works like a champ. Just use sessionStorage.curPage to retreive it. See here: http://code.google.com/p/sessionstorage/

      May be a good add to the base code, eh Wes? Just as a perk? 🙂

  82. Hi Wes, forgot to ask which event I should be listening for, when someone clicks on any of the pajinate page links.

    Brett

    January 16, 2012 at 3:43 am

    • I’d probably put a click handler on “a.page_link”.

      Wes

      January 17, 2012 at 4:20 pm

      • Thank you for the reply, Wes

        Brett

        January 17, 2012 at 4:32 pm

  83. Hi!

    It does not work in ie7. How to do it?

    Other browser render this code http://dl.dropbox.com/u/7602095/chrome.png
    while ie7 renders http://dl.dropbox.com/u/7602095/ie7.png ( i.e. Not generating the anchors after ).

    Please help.

    Regards
    Sheikh Naveed
    UI Designer

    Sheikh Naveed

    January 29, 2012 at 11:53 pm

    • Strange that. Does my demo page work on ie7?

      Wes

      January 30, 2012 at 10:17 pm

  84. Es posible implementar un callback al cambiar de pagina ?
    Seria muy util para hacer algun efecto de transicion en los elementos.
    Ya que el cambio de pagina es tan rapido que no da la sensacion de haberse refrescado el contendido.
    Muchas Gracias

    Edgardo

    February 3, 2012 at 1:50 am

  85. I was wondering if you’ve come across a reason why items wouldn’t be hidden on page load? I’m paging a bunch of divs and the navigation appears correctly (right # of tabs) and the info text shows correctly. I have 65 divs and I’ve set it to 2 per page for easy debugging. Info text shows “Showing 1-2 of 65 results”, but all 65 show. If I click to the second page it correctly shows divs 3 & 4. If I then click page 1 I correctly see divs 1 & 2.

    Any ideas?

    http://www.heartofbusiness.com/alumni-community-list/

    Greg

    March 2, 2012 at 9:37 pm

  86. […] […]

  87. Nice. but, i am facing one issue.
    I am having multiple pagination in a page.
    If i am clicking on ‘last’ page of the first pagination, ‘no_more’ styles geeting added in the other pagination links also.
    This was happening when i am using 1.6.2.min library and it is working in 1.4.2 which you used.
    But i am maintaining common js lib throughout my site. So, i want to make this getting solved with 1.6.2.min itself. Kindly reply as soon as possible.

    websathish

    April 5, 2012 at 9:21 am

    • Oh no! Sounds like a bug to me. Could you log it in the “issues” tab on github please 🙂

      Wes

      April 5, 2012 at 9:23 am

      • Ok wes,
        Can you check and tell me the solution.

        websathish

        April 5, 2012 at 9:25 am

      • Hi Wes,

        Any Clue.?

        websathish

        April 5, 2012 at 9:46 am

      • Hi Wes,
        Suggest me any idea about this issue. I will try to sort this.
        Whether we need to do some modification in “tagNextPrev” function.

        websathish

        April 6, 2012 at 4:43 am

  88. […] Pajinate is a jQuery plugin that can auto-generate a paginated navigation for list items or any other areas of content. […]

  89. Awesome post , but i found another plugin ” jPages jQuery Plugin” withe more features. the short post goes here Creating Client-side Pagination with jPages jQuery Plugin hope you will like to see. thanks

    Navin Kunwar

    April 14, 2012 at 6:44 pm

  90. […] 2. Pajinate – A jQuery Pagination Plugin […]

  91. […] Pajinate – A jQuery Pagination Plugin […]

  92. For those of you paging lots of results specifically with images, a workaround to prevent modifiying the script to dynamically load results is to use http://www.appelsiini.net/projects/lazyload

    Which only loads visible images works perfectly with this plugin.

    Joel Davey

    May 10, 2012 at 4:33 pm

    • Thanks for the tip! How did you manage to load the images of the subsequent pages? Only the images in the first page are dynamicaly loaded. Going to the next page doesn’t load the images of that page. Hope you can help me on this.

      Eugene

      April 25, 2013 at 2:49 pm

  93. Forgot to add in my last post, if your using lazy load I also needed to add $(“body”).trigger(“scroll”); at the bottom of all the functions handling the pages e.g showNextPage

    Joel

    May 10, 2012 at 6:34 pm

  94. Hey I am using pajinate plugin it works fine. Is their way to reset pagination after applying data manipulation like sort or filtering the list items.

    prasofty

    May 17, 2012 at 6:30 am

  95. Hi Wez, I tried to make the page jump to the top using the name link method, but after modifying the script by adding a tag on the 5 hrefs and clicking the pagination, nothing happens! What am I doing wrong?

    Kev

    May 29, 2012 at 12:09 pm

    • worked it out. next this to fix is the current page is a link instead of a span.

      budinsky

      June 10, 2012 at 7:38 am

  96. hi Wes, thanks for the simply and efficient plugin, I shared it on my Facebook and soon i’ll write a little rec on my blog!
    can You tell me how remove prev-first when the user is on first page, and next-last when the user is on the last page?
    Thank you in adavnced

    Luca

    May 30, 2012 at 1:57 pm

  97. […] Je vous en parle ici Insérez la pagination via jQuery sur votre site internet. Le site […]

  98. […] Demo   :   Source Code   :   Visit Site […]

  99. […] Unlimited Levels Vertical Drop-Down Navigation Menu Download & Docs → Demo →PajinatePajinate is a simple and flexible jQuery plugin that allows you to divide long lists or areas of […]

  100. Hi, this is a great code . . its working fine but in the pagination links i.e. First Prev 1 2 3 …. am not getting formatted o/p. Its displaying page links as 1234. . I am implementing #paging_container1…

    Preeti

    June 21, 2012 at 6:50 am

  101. how to use this in table?
    I’ve tried it but did not succeed
    This can not count the number of rows to be displayed
    (I am sorry about my bad english, I use google translation)

    paradisa

    June 29, 2012 at 9:04 am

  102. Awesome plugin, thank you! I am using pajinate with jquery cycle to page through an image thumbnail index. What I would like to do is, instead of page numbers, display the range of items on each page. For example, 1-15, 16-30, 31-40. Are you aware of any modifications that would allow this? Thanks.

    pchap

    July 11, 2012 at 11:59 pm

    • Update. I was able to solve this with the following, beginning on line 94. In case someone finds it useful:

      case “num”:
      navigation_html += less;
      var current_link = 0;
      // Display a range of items per page in place of page numbers (e.g. 1-5, 6-10, 11-15, etc.)
      while (number_of_pages > current_link) {
      var range_value = options.items_per_page; // The number of items per page
      var range_from = (current_link * range_value) + 1; // Start value per page
      var range_to = (range_from + range_value) – 1; // End value per page
      var remainder = total_items % range_value; // Remainder
      var range_last = range_from + remainder; // Used on last page for when items are not evenly divisible (e.g. 1-5, 6-10, 11-13)

      // If not last page
      if (number_of_pages != (current_link + 1) ) {
      navigation_html += ‘‘ + range_from + ‘-‘ + range_to + ‘‘;
      }

      // Last page
      else {
      navigation_html += ‘‘ + range_from + ‘-‘ + range_last + ‘‘;
      }

      current_link++;
      }

      pchap

      July 13, 2012 at 12:45 am

  103. […] 10 jQuery Pagination Plugins #followform { padding-top:5px; text-align:left; } popping..1. Pajinate – A jQuery Pagination Plugin […]

  104. hey, great script, i get something wrong though, i set the parameters to display 3 per page and i get the first to display 2 and the rest 3. the start page is set to 0. any ideas?

    chris

    September 9, 2012 at 6:33 pm

  105. Hello @wesnolte,
    I download your script jquery.pajinate, and I need one small modification, but I can’t modify this.
    Now I have this:

    [1] – active page

    But I need something like this:
    (9 is last page)

    Please help me 🙂

    piotrex41

    October 18, 2012 at 12:20 pm

  106. Awesome plugin. Very easy to implement. Thanks a million for your fine work!

    Ilker Taskaya

    November 4, 2012 at 8:22 am

  107. […] 5. Pajinate – A jQuery Pagination Plugin […]

  108. Any way to have a callback function? Thanks!

    Justin

    January 7, 2013 at 10:00 pm

  109. Thanks.. this is awesome.

    sudarpo

    January 17, 2013 at 2:28 am

  110. […] 3. Pajinate […]

  111. Excellent plugin! Found it very useful. Thanks a lot for sharing.

    wecode

    February 7, 2013 at 4:33 am

  112. […] – A jQuery Pagination Plugin – MORE INFO / DEMO […]

  113. […]   […]

  114. Thanks for the plugin wes, worked perfectly

    Willy Joe

    March 14, 2013 at 1:22 am

  115. Great plugin; any updated re filtering integration?

    danjelv

    March 15, 2013 at 12:16 pm

  116. Hi,
    how can I remove an orange highlighting of every second tag?

    Thank you!

    Juraj

    March 23, 2013 at 3:54 pm

  117. […] jQuery Pajinate […]

  118. […] jQuery Pajinate […]

  119. […] jQuery Pajinate […]

  120. Is there a way to append the URL so that you can use the browser’s back button along with the paginaton? e.g. http://www.sitename/category#page1, http://www.sitename/category#page2, http://www.sitename/category#page3 etc….

    mpoisel

    May 15, 2013 at 10:03 pm

  121. Excellent plugin.. incredible, really beautiful plugin.

    Narayanaswamy V

    May 23, 2013 at 3:48 pm

  122. […] Pajinate […]

  123. […] jQuery Pajinate […]

  124. Excellent Plugin, works like charm.. made life easier, i have one question if i jump from page number one to page number ten it doesn’t allow me to move pages left and doesn’t show the page links 8,9,10 as i have given three page links to be displayed ….could you please help on this

    Narayanaswamy v

    July 24, 2013 at 12:13 pm

  125. […] MORE / INFO DEMO […]

  126. […] – COMPLETE INFO & DOWNLOAD […]

  127. […] Pajinate : A jQuery Pagination Plugin […]

  128. if I want to show two columns. Where place can i write code?
    because i use “Show Subset of Page Links” type of pagination.

    Please! help me too. Thanks!

    kosal

    September 12, 2013 at 10:07 am

  129. […] MORE / INFO DEMO […]

  130. Hi, Can anybody test this plugin with jquery-1.10.2.min.js ????

    Supriya Waghamale

    November 12, 2013 at 8:30 am

  131. […] Pajinate […]

  132. […] MORE / INFO DEMO […]

  133. […] jQuery Pajinate […]

  134. You ROCK!

    Pascal

    January 18, 2014 at 1:12 am

  135. […] Paginate […]

  136. Hi, great Plugin, i’m using it for an internal messaging system, but theres a small problem;

    When i delete a message i currently also set the “li” tag to “display: none;” so that the message (that has been deleted via ajax in the background) immediately disappears.

    Then, of course, i have one message less on that page, although there are more on page 2,3,4… etc

    Is it possible to make page one getting “filled” with the “li”s from the next pages when disabling / removing a “li” on page one? Like a function, that removes a given “li” and “recalculates” the pagination or something like that?

    BF

    March 14, 2014 at 10:49 am

  137. Hi, i found a solution myself:

    I give the “li”s uniquie IDs and when i delete a message i remove that “li” via jQuery’s remove() function and then call the pajinate() function again 🙂

    BF

    March 14, 2014 at 12:12 pm

  138. […] Pajinate […]

  139. […] Pajinate […]

  140. […] Pajinate – A jQuery Pagination Plugin […]

  141. […] Pajinate – A jQuery Pagination Plugin […]

  142. […] MORE / INFO DEMO […]


Leave a reply to Edgardo Cancel reply