Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个链接到锚点的页面:
<a name="1"></a>
与链接
<a href="examplepage.htm#1">Link</a>.
当我在锚点所在的页面中单击该链接时,它会按预期工作。但是,当我从另一个页面单击该链接时,它会按预期在锚点处加载页面,但随后会在几分之一秒后恢复到页面顶部。
不知道为什么,我所有的研究都被关于如何链接到页面顶部的教程所迷惑,这与我想做的相反!
任何帮助深表感谢。
谢谢,奥利。
您正在调用scroll()函数onload!
scroll()
onload
<body class="LTR Safari Chrome Safari18 Chrome18 ENUS ContentBody" onload="scroll()">
I have the following code:
document.getElementById("launcherDiv").innerHTML = "<object id='launcher' classid='CLSID:17E88883-3488-46B8-BE4D-30568888855' codebase='Helper.CAB#version=8