well i am displaying a dynamic gallery using PHP… what i want is to instead of showing a lot of thumbnails on one page i rather do paging.. you know the number pages and next and all..
well its an old thing but i don’t know how to do this..
- HOW TO DO IT ?
but hold your horses HERES THE TWIST
i am showing thumbnails in DIVS which i set in line so lets say if someone open the page in 1024×768 i get 3 thumbnails in a row and and there are 6 rows so they make 18 thumnails on the whole..
but if someone open the page with their resolution lets say 1600 x 1200 i get 5 thumnails in a row so 18 thumbnails would make 3 rows.. lets say i want to keep the rows 6 and pop up the thumbnails to 30… HOW TO RIDE A CODE TO DO THAT
p.s. best of luck with my crazy thangs….
The basic technique is this: You know, or else calculate, how many images you’re displaying per page. So when you do your query, that’s your LIMIT. Also, you’re going to need an offset – how many results you need to skip over. If you were showing 8 results per page and you wanted to show the 3rd page, your offset would be (3 – 1) * 8, or 16.
Now, your interesting challenge sounds like your display: You’re showing different amounts of thumbnails based on the display. So you will need to calculate how big of a display you want, probably with javascript, and then make an ajax request to query for the amount of results you want and the offset, based on the page you’re showing.