brandon88tube Posted April 12, 2009 Share Posted April 12, 2009 I've been stumped over this for a while so I really hope someone can help me out here. I'm trying to build a pagination that only displays a set number of pages and then when the last number is clicked it will shift the numbers starting with the one just clicked. Then I would like it to set the first number to shift back to the other pair of numbers if it was clicked. Example: 1 2 3 4 5 , you click 5 it then displays 5 6 7 8 9 and if you were to click 5 again it would go back to 1 2 3 4 5. Clicking 9 would then display 9 10 11 12 13. Now if any number in between these numbers are clicked it should just display what is already there as in 5 6 7 8 9 if 6-8 were clicked. I might be able to get this working if I send some of the variables in the URL, but I DO NOT want this and even that is slightly difficult. Link to comment https://forums.phpfreaks.com/topic/153695-help-with-complicated-pagination/ Share on other sites More sharing options...
MasterACE14 Posted April 12, 2009 Share Posted April 12, 2009 if you have a variable for the current page, you can just minus/plus 1,2,3,4,5 from it to get the pages you want on either side of the current one. Link to comment https://forums.phpfreaks.com/topic/153695-help-with-complicated-pagination/#findComment-807707 Share on other sites More sharing options...
CarbonCopy Posted April 12, 2009 Share Posted April 12, 2009 If you think get variables are too complicated, you need to go learn PHP Link to comment https://forums.phpfreaks.com/topic/153695-help-with-complicated-pagination/#findComment-807714 Share on other sites More sharing options...
brandon88tube Posted April 12, 2009 Author Share Posted April 12, 2009 if you have a variable for the current page, you can just minus/plus 1,2,3,4,5 from it to get the pages you want on either side of the current one. I'm not quite understanding you as what you said is kind of vague. Link to comment https://forums.phpfreaks.com/topic/153695-help-with-complicated-pagination/#findComment-807719 Share on other sites More sharing options...
brandon88tube Posted April 13, 2009 Author Share Posted April 13, 2009 I'm bumping this as these answers really haven't helped. Link to comment https://forums.phpfreaks.com/topic/153695-help-with-complicated-pagination/#findComment-808334 Share on other sites More sharing options...
.josh Posted April 13, 2009 Share Posted April 13, 2009 Why wouldn't clicking a middle-of-the-range number cause it to become the first or last in the range, as well? TBH I think you're doing something that's not really useful/practical. At most, I would leave the normal links alone and have separate links that bump up/down to the next/previous range bracket. Regardless though, you're going to have to pass values through the url eventually. Unless you're making each link a submit button, being passed via post, or using ajax via post method. But overall, link format manipulation w/out actually making a request is really a javascript issue. Link to comment https://forums.phpfreaks.com/topic/153695-help-with-complicated-pagination/#findComment-808340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.