Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    19
    Thanks
    10
    Thanked 1 Time in 1 Post

    Question Remembering scrollbar position

    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:

    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
    Last edited by melissadiane; 06-29-2009 at 02:16 PM.

  • #2
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,371
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    You might find some solutions here:

    http://www.google.com/search?q=javas...on&btnG=Search

  • Users who have thanked mlseim for this post:

    oesxyl (06-29-2009)

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Also you may want to remove any sensitive information in your post.
    Last edited by _Aerospace_Eng_; 06-29-2009 at 02:06 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    melissadiane (06-29-2009)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •