Pagination With Javascript
I have html code that have some
inside. I want to paginate them with javascript. How can I do that? (I know I can do it by PHP but I just want to do it wit
Solution 1:
yea there is a jquery plugin that works nicely https://github.com/gbirke/jquery_pagination
Solution 2:
I would first get the count of items. For example, if you have 10, loop through and create <div>
s for each. [1][2][3]... Then, when you click on a pager <div>
, get the value and request that specific item such as $("#ct").load("/posts?id=5");
Solution 3:
Solution 4:
Yes, using jQuery to simulate pagination is a valid task. You could easily use the jQuery(selector).hide().slice(start,end).show()
pattern to do what you want. Then you have to manage the start and end in your code, but that should be easy enough.
Solution 5:
You can use Pagino. It's very easy and simple https://github.com/pagino/pagino-js
Post a Comment for "Pagination With Javascript"