melissadiane
06-28-2009, 11:17 PM
Hello everyone,
I have a gallery for a client located at http://www.permacastwalls.com/gallery2.php.
The client is unhappy that the scrollbar on the filmstrip at the top "pops" back to the beginning when a new picture is loaded. I can see his point, but I'm not sure how to fix this. Right now, it's written in PHP. I know only a little Javascript. Here is the relevent code:
<div id="gallery">
<?php
$thumb_dir = "images/thumb/";
$mid_dir = "images/mid/";
$full_dir = "images/full/";
$con = ... or die('Could not connect to server');
mysql_select_db("permacast_photos", $con) or die('Could not retrieve photos');
$query = "SELECT * FROM photos";
$result = mysql_query($query);
$num = 1;
echo '<div id="thumb_strip">';
while ($row = mysql_fetch_array($result)) {
echo '<span class="thumb">';
echo '<a href="gallery2.php?picture=' . $row["Title"];
echo '&num=' . $num;
echo '"><img src="';
echo $thumb_dir . $row["Filename"];
echo '" /></a></span>';
$num++;
}
echo '</div>';
echo '<div style="height: 130px"><!-- --></div>';
echo '<div id="main_image">';
if (!isset($_REQUEST['picture'])) {
echo '<p>Choose a picture from above.</p>';
} else {
$picture_title = $_REQUEST['picture'];
$picture_num = $_REQUEST['num'];
$query = "SELECT * FROM photos WHERE Title='$picture_title'";
$result = mysql_query($query); // or die( mysql_error());
$row = mysql_fetch_array($result);
$filename = $row["Filename"];
echo '<a href="picdisplay.php?filename=' . $full_dir . $filename . '">';
echo '<img src="' . $mid_dir . $filename . '" /></a><br />';
echo '<p>#' . $picture_num . ': ' . $row["Caption"] . ' <span class="click_here">Click to enlarge image.</span></p>';
}
echo '</div>';
?>
</div> <!-- end gallery -->
I'd really appreciate any help or suggestions with this.
-Melissa
I have a gallery for a client located at http://www.permacastwalls.com/gallery2.php.
The client is unhappy that the scrollbar on the filmstrip at the top "pops" back to the beginning when a new picture is loaded. I can see his point, but I'm not sure how to fix this. Right now, it's written in PHP. I know only a little Javascript. Here is the relevent code:
<div id="gallery">
<?php
$thumb_dir = "images/thumb/";
$mid_dir = "images/mid/";
$full_dir = "images/full/";
$con = ... or die('Could not connect to server');
mysql_select_db("permacast_photos", $con) or die('Could not retrieve photos');
$query = "SELECT * FROM photos";
$result = mysql_query($query);
$num = 1;
echo '<div id="thumb_strip">';
while ($row = mysql_fetch_array($result)) {
echo '<span class="thumb">';
echo '<a href="gallery2.php?picture=' . $row["Title"];
echo '&num=' . $num;
echo '"><img src="';
echo $thumb_dir . $row["Filename"];
echo '" /></a></span>';
$num++;
}
echo '</div>';
echo '<div style="height: 130px"><!-- --></div>';
echo '<div id="main_image">';
if (!isset($_REQUEST['picture'])) {
echo '<p>Choose a picture from above.</p>';
} else {
$picture_title = $_REQUEST['picture'];
$picture_num = $_REQUEST['num'];
$query = "SELECT * FROM photos WHERE Title='$picture_title'";
$result = mysql_query($query); // or die( mysql_error());
$row = mysql_fetch_array($result);
$filename = $row["Filename"];
echo '<a href="picdisplay.php?filename=' . $full_dir . $filename . '">';
echo '<img src="' . $mid_dir . $filename . '" /></a><br />';
echo '<p>#' . $picture_num . ': ' . $row["Caption"] . ' <span class="click_here">Click to enlarge image.</span></p>';
}
echo '</div>';
?>
</div> <!-- end gallery -->
I'd really appreciate any help or suggestions with this.
-Melissa