views:

100

answers:

1

Hello,

I am using this javascript (Super Table) to transform my table in a div to freeze the top header and left column. The scrollable area has columns with textboxes that corrospond to a specific month and year. I would like to have the horizontal scroll position to match the current month and year. I create the table programmatically and add it to a placeholder in an asp.net code behind.

Is it possible to add a class to a table cell and then use javascript or jquery to move the horizontal scroll bar to the table cell with the current month class? If so, how? I am not that great with javascript beyond the basic validation stuff. Any other ideas would be appriciated, too.

Thank you.

Ben

A: 

Update

This plugin might help you out: http://flesler.blogspot.com/2007/10/jqueryscrollto.html


Using purely HTML you can give it an id instead a class and then at the end of the url you would add "#id_here" and the page should navigate to the cell. However, I have never tried that in a scrolling div, so I can't be for sure.

Example code:

<td id="current_date"></td>

Then the link would be:

Page.aspx#current-date
ryanulit
This didn't work. It seemed to mess up the way the table rendered, and it also moved the vertical scrollbar and not the horizontal scroll bar.
Ben
Your update worked perfectly. Thank you! For anyone else that needs to use it, the trick is to use the tables onfinish event to assign a function that uses the sData class to specify where to scroll to.
Ben
Glad I could help.
ryanulit