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

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.