<分区>
标签 javascript jquery html css
<分区>
我不确定我能否很好地描述这一点。我想在 HTML 内容中添加一个元素,它会在加载时自动要求浏览器垂直滚动到那里。像一个 anchor 。所以:
| visible area |
| content html |
| content html | our monitor
| content html |
| content html |
----------------
|
|
| * here comes the HTML element which will ask the browser to scroll here
|
|
最佳答案
$(document).ready(function()
{
$("html,body").animate({scrollTop: 200}, 1000);
}
没有测试所以如果它行不通请告诉我
关于javascript - 如何在 HTML 中自动垂直滚动到一行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26192215/