将div滚动条设置到特定位置
我正在使用这个 javascript (Super Table) 将我的表格转换为 div 以冻结顶部标题和左栏。可滚动区域的列包含与特定月份和年份相对应的文本框。我希望水平滚动位置能够匹配当前月份和年份。我以编程方式创建该表,并将其添加到后面的 ASP.NET 代码中的占位符中。
是否可以向表格单元格添加一个类,然后使用 javascript 或 jquery 将水平滚动条移动到具有当前月份类的表格单元格?如果是这样,怎么办?除了基本的验证之外,我对 javascript 不太了解。任何其他想法也将受到重视。
谢谢。
本
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新
这个插件可能会帮助你:http://flesler .blogspot.com/2007/10/jqueryscrollto.html
使用纯 HTML,您可以给它一个 id 而不是一个类,然后在 url 末尾添加“#id_here”,页面应导航到细胞。但是,我从未在滚动 div 中尝试过,所以我不能确定。
示例代码:
那么链接将是:
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:
Then the link would be: