Jump to content

Pagination like a carousel


1internet

Recommended Posts

I want to have my results slide out and slide in just like a carousel. So my results are 3x3, and then whenever you click next, the existing results slide out to the left, and at the same time the new results slide in from the right hand side.

 

If this is done then would it mean I have to download all the results, so they are stored, and can thus slide in immediately, without an ajax load? Or is there some other amazing way to accomplish a task like this?

Link to comment
https://forums.phpfreaks.com/topic/282024-pagination-like-a-carousel/
Share on other sites

You can either download all the data and have the functionality completely run client-side or you can progressively load more results as the user clicks the next button. There are advantages and disadvantages for both methods. Here are some:

 

Download all data:

 

Advantages:

Will run very fast with little to no delay (assuming that the total data is not excessively large)

In my opinion, this is typically easier to implement

 

Disadvantages:

Will not update if any changes to the data takes place after page load

Will not scale with large data sets

 

Progressively load data (i.e. AJAX)

Advantages:

Will scale for scenarios with a lot of data. If there is a ton of data this may be the only viable option.

Can adjust dynamically if data changes after initial page load

 

Disadvantages:

There can be a slight lag in displaying more results. This can be reduced by "thinking ahead" - for example, load the next page beforehand. When page loads get page 1 and page 2. When user navigates to page 2, immediately show page 2 data and then get page 3 data.

This can be a little more difficult to implement

  On 9/10/2013 at 12:07 AM, 1internet said:

What if we used a combination of both, e.g. it downloads the first 5 pages, and if a visitor tries to go further than those results it dowloads the next 5 pages of results too?

 

Which is basically what I already stated

 

 

  Quote
This can be reduced by "thinking ahead" - for example, load the next page beforehand. When page loads get page 1 and page 2. When user navigates to page 2, immediately show page 2 data and then get page 3 data.

You can do whatever you want. The more complicated you make it - the more complicated it will be to code. It all depends on your needs and the cost/benefit of any solution.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.