Gallery combination
Right,
I've got a gallery on a simple site I made for a friends band (apologies in advance if the red is overwhelming)
http://fourworldtheory.com/gallery.php
It does it's job BUT when you click on a thumbnail the scroll bar jumps back to the beginning (I know this is because the page re-loads)Which is quite annoying.
I've been playing with this gallery
http://fourworldtheory.com/scroll_gallery.html
And it doesn't jump BUT I have to put all the images in the html first, which is very time consuming etc when there's so many images.
Does anyone know if I can combine the two as it were?
Have the php script load the images, then have the gallery that doesn't jump back to the beginning?
Posted this in
webdev as well.
<div style="width: 800px; white-space: nowrap; overflow: auto; height: 85px;">
<?
$d = opendir("/home/james/sites/fourworldtheo ry.com/images/pictures_of_us/thumbs/");
while(false !== ($f = readdir($d))) {
if($f == "." || $f == "..") continue;
print("\t<a href=\"/gallery.php?img=pictures_of_us/" . str_replace("50", "lg", $f) . "\"><img src=\"/images/pictures_of_us/thumbs/$f\" alt=\"\"/></a>\n");
}
?>
</div>
<p />
<b>Click to enlarge</b>
<p />
<? if(isset($_GET["img"]) && file_exists("/home/james/sites/fourworld theory.com/images/$_GET[img]")){
print("<img src=\"/images/$_GET[img]\" alt=\"\"/>");
}?>
</div>
Note: a friend helped me with the php, still very much a beginner myself
I've got a gallery on a simple site I made for a friends band (apologies in advance if the red is overwhelming)
http://fourworldtheory.com/gallery.php
It does it's job BUT when you click on a thumbnail the scroll bar jumps back to the beginning (I know this is because the page re-loads)Which is quite annoying.
I've been playing with this gallery
http://fourworldtheory.com/scroll_gallery.html
And it doesn't jump BUT I have to put all the images in the html first, which is very time consuming etc when there's so many images.
Does anyone know if I can combine the two as it were?
Have the php script load the images, then have the gallery that doesn't jump back to the beginning?
Posted this in
webdev as well.<div style="width: 800px; white-space: nowrap; overflow: auto; height: 85px;">
<?
$d = opendir("/home/james/sites/fourworldtheo
while(false !== ($f = readdir($d))) {
if($f == "." || $f == "..") continue;
print("\t<a href=\"/gallery.php?img=pictures_of_us/"
}
?>
</div>
<p />
<b>Click to enlarge</b>
<p />
<? if(isset($_GET["img"]) && file_exists("/home/james/sites/fourworld
print("<img src=\"/images/$_GET[img]\" alt=\"\"/>");
}?>
</div>
Note: a friend helped me with the php, still very much a beginner myself