1internet Posted September 9, 2013 Share Posted September 9, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/282024-pagination-like-a-carousel/ Share on other sites More sharing options...
Psycho Posted September 9, 2013 Share Posted September 9, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/282024-pagination-like-a-carousel/#findComment-1448915 Share on other sites More sharing options...
1internet Posted September 10, 2013 Author Share Posted September 10, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/282024-pagination-like-a-carousel/#findComment-1448918 Share on other sites More sharing options...
Psycho Posted September 10, 2013 Share Posted September 10, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282024-pagination-like-a-carousel/#findComment-1448931 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.