0

so i dont know how to explain what im trying to do... maybe this is why i cant find any information on google.. but ill try

so i want to do for example i have 100 photos but i only wanna display 25 on each page and if is more than 25 show the page [2] button

An idea on how to do it would be great, thanks

4
Contributors
3
Replies
29
Views
3 Years
Discussion Span
Last Post by Bachu
2

if the photos name and file name are stored in the database, you need pagination. We have plenty of pagination scripts and threads here in Daniweb.

if the photos are in the directory and you are reading the contents by way of PHP, then you want the pagination using javascript as shown here. DynamicDrive's example is only for one image. For 25 images, you can modify the demo script to this...

<script type="text/javascript">

var pagecontent=new virtualpaginate({
 piececlass: "virtualpage", //class of container for each piece of content
 piececontainer: "div", //container element type (ie: "div", "p" etc)
 pieces_per_page: 25, //Pieces of content to show per page (1=1 piece, 2=2 pieces etc)
 defaultpage: 0, //Default page selected (0=1st page, 1=2nd page etc). Persistence if enabled overrides this setting.
 wraparound: false,
 persist: false //Remember last viewed page and recall it when user returns within a browser session?
})

pagecontent.buildpagination(["paginatediv"])

</script>

Here is another one.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.