【发布时间】:2025-12-03 15:10:01
【问题描述】:
我有一个隐藏的输入字段,在表 td 内,当我选择选项 A 时,我希望浏览器向下滚动到 table td 内的可见输入。
我试过下面的代码,但有些东西不正常。
输入字段ID:#id_a-1-host
jQuery('html,body').animate({scrollTop: jQuery('#id_a-1-host').offset().top},'slow');
它向下滚动但只有一点点。它没有向下滚动到输入字段。
【问题讨论】:
-
将 id 提供给 td 本身。
-
嗨!给 td 提供 ID 不起作用;(.
-
@Jai 你无法通过将
id提供给<td>来导航...
标签: jquery jquery-animate