Search code examples
javascriptphphtmlphotos

Javascript browsing through photo-collection


I would like to make a website where I can present some project of my client. He's an architect and wants his customers to be able to scroll through his buildings and projects.

Goal is to make a grid (3 wide, infinite long) of photos. In every square a project is displayed with max. 12 photos. I would like to display them in a way the users of the website can click on an image and scroll to the next one.
If the user clicks on another grid-item, the one he previously was clicking on, should stay in the same state (last shown photo) as it was before.

The photos are in a database and are coming in an array in the HTML (that's how to do it I guess, right?). I was thinking of using the URL as a reference to let the grid know which photo to show, but that's kind of useless since the grid-item has to remember his last state.

So I figured out Javascript is the way to go. I know a lot about HTML and PHP but my Javascript-skills aren't this sharp. Could anybody give me some advice or hits how to work this out?

enter image description here


Solution

  • I found my solution in the JQuery Cycle-plugin! Thanks for the effort though!