Jump to content

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

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

 

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.