[web] Photo Gallery

Started by
2 comments, last by Rob Loach 19 years, 2 months ago
Any ideas on setting up a good photo gallery? Or any links to some really good designs? I kind of want any given picture to open in a new window, to make things easy and so the page doesn't have to reload all the time. Is this a good idea? Would pop-up blockers block this or no? Tips and ideas welcome. Links too. Anything on setting up a good image gallery. Thank you!!
Advertisement
Let's do this right.
You could use &#106avascript to load another image into an IMG element when a button is clicked or something... Assuming your images are simply indexed (i.e. img10.gif, img11,gif, img12.gif, etc.), then you can just search for the next image. If the file doesn't exist, either wrap to the first image, or do nothing.

If your images don't go in order numerically and you're looking to do something more advanced, create a dynamic page that takes a query string containing the current image index, such as...

http://yoursite/getNextImage?curImg=1027

Then the getNextImage page could perhaps return some XML like the following:

<?xml version="1.0" ?><image id="1043">    <src>/images/img1043.gif</src>    <nextImg>1057</nextImg></image>


Simply call this page in your &#106avascript, and you can parse the XML to display the image in the same page as in the first example.<br><br>Hopefully that made sense, I'm distracted playing Texas Hold'em &#111;nline :-P
I think my method is pretty effective for poping up larger images of thumbnails. The source for it is available here (ImageThumbnail).
Rob Loach [Website] [Projects] [Contact]

This topic is closed to new replies.

Advertisement