Ben
Ben

Reputation: 77

Set div scrollbar to specific position

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

Upvotes: 1

Views: 2636

Answers (1)

ryanulit
ryanulit

Reputation: 5001

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

Upvotes: 1

Related Questions