如何使用箭头键在 html 表格中向下滚动?
我正在开发一个网络应用程序并遇到以下问题。
我的页面中有两个表,当我在 table1 中选择一行时,table2 中的第一行被选中。我想使用箭头键向下滚动 table2 (无需单击 table2 的任何行)。但是当我使用箭头键时,滚动条不起作用。仅当我单击 table2 中的一行后它才起作用。
有没有任何 javascript 解决方案?
I'm developing a web application and encountered following problem.
there are two tables in my page and when i select a row in table1 , first row in table2 get selected.I want to scroll down the table2 using arrow keys(without click in any row of table2). But when I use arrow keys, scroll bar doesn't work. It work only after I click a row in table2.
Is there any javascript solution for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要设置焦点:
You may need to set the focus:
您可能会从 javascript 获得按键和滚动。 jQuery 的滚动解决方案:
将滚动到从顶部 300px 500ms
You may get pressed keys and scroll from javascript. Scrolling solution for jQuery:
will scroll to 300px from top by 500ms