Forum Moderators: open

Message Too Old, No Replies

Scroll bar in table cell help

         

anubis81

6:26 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



First of all, thanks to all who have unwittingly helped me by helping others on the forums.

My current problem deals with a scroll bar in a table cell. The table holds an image gallery and is made up of three columns. Left column is site navigation bar, middle is full size image and right is thumbnails with a vertical scroll bar. The images are loaded dynamically from urls in a MySQL database. There are two recordsets on the page, one for the full image so it can be filtered to the one image using a URL parameter from a link tied to the thumbnails. The second recordset is for the thumbnails to allow all to be displayed in a repeating region. So far everything works beautifully....except whenever I load a new full size image by clicking on a thumbnail the scroll bar returns to the top. Seeing as how there are currently 70 images in the gallery this can get quite annoying. Is there a way to hold the scroll bar in place when the page is loaded with a new URL parameter for the main image?

Thanks in advance,

David

If it helps, here is the code for the cell is question.

<td width="105" rowspan="6"><div style="height:455px; width:100px; overflow:auto;">
<%
While ((Repeat1__numRows <> 0) AND (NOT rsthumbs.EOF))
%>
<table width="30">
<tr>
<td><a href="index.asp?Image_ID=<%=(rsthumbs.Fields.Item("Image_ID").Value)%>#1"><img src="<%=(rsthumbs.Fields.Item("Thumbnail_Path").Value)%>" border="0"></a></td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsthumbs.MoveNext()
Wend
%></div></td>

flairprime

7:07 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



You could just set the table cell up with a spacer graphic set to that size, and then layer a div tag over it.

<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>

[edited by: tedster at 8:16 pm (utc) on April 29, 2005]

anubis81

8:13 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



I'm sorry, but being somewhat of a newbie to this I don't quite get what you are saying to do. I have a 1x1 transparent spacer.gif that I've used in other places but I don't see how that will help my scrolling problem. Excuse my ignorance.

tedster

8:20 pm on Apr 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A new url parameter means you actually have a new page - a new document - so it will naturally load at the top. If you want it to load somewhere other than at the top, you could place a named anchor in that spot in the document (<a name="thisspot"></a>) and then append a "#thisspot" to the new url.

anubis81

9:43 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



Is there perhaps a way using JavaScript to detect the current position of the scroll bar and load with the new URL parameter and the scroll bar in the same position? I know I've seen some things that hint at this use but haven't seen an implementation of it yet.

David

anubis81

2:26 am on Apr 30, 2005 (gmt 0)

10+ Year Member



Problem solved with a simple iframe to hold the main image in a separate document. Learning new things everyday.