【发布时间】:2009-11-10 15:35:09
【问题描述】:
假设我有以下页面:
<html>
<body>
<div id='foo' style='scroll:auto;height:400px'>
// content, content, content...
<div id='bar'></div>
// content, content, content...
</div>
</body>
</html>
我可以使用什么 jQuery(或 vanilla Javascript),以便在页面加载时,仅在 div#foo 内(而不是整个页面)跳转到#bar?我不需要花哨的动画或滚动,我只希望 #bar 在页面加载时位于 div 的顶部。
【问题讨论】:
标签: javascript jquery html xhtml