重定向到其他 html 页面和 scrollTop: 到某个 div
Redirect to other html page and scrollTop: to a certain div
已经有人问过了,但是给出的两个答案对我不起作用。
Redirect to some other page then animate to reach a certain scrollTop
我的 html 是这样的:
html1:
<!doctype html>
<html clalang="en">
<head>
</head>
<body>
<a href="index.html" id="boxes">boxes</a>
</body>
</html>
html2:
<!doctype html>
<html clalang="en">
<head>
</head>
<body>
<div id="goto"></div>
</body>
</html>
所以当你在 html1 中单击时,我需要在 html2 中转到
感谢您的帮助!
这就是 url 哈希的用途:
<a href="index.html#goto" id="boxes">boxes</a>
浏览器会自动滚动到匹配的 id
已经有人问过了,但是给出的两个答案对我不起作用。 Redirect to some other page then animate to reach a certain scrollTop 我的 html 是这样的:
html1:
<!doctype html>
<html clalang="en">
<head>
</head>
<body>
<a href="index.html" id="boxes">boxes</a>
</body>
</html>
html2:
<!doctype html>
<html clalang="en">
<head>
</head>
<body>
<div id="goto"></div>
</body>
</html>
所以当你在 html1 中单击时,我需要在 html2 中转到
感谢您的帮助!
这就是 url 哈希的用途:
<a href="index.html#goto" id="boxes">boxes</a>
浏览器会自动滚动到匹配的 id