📌  相关文章
📜  按 id 滚动到元素 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:05.428000             🧑  作者: Mango

代码示例2
You can use an anchor to "focus" the div. This will bring the Div to the top of the page
I.e:

and then use the following javascript: // the next line is required to work around a bug in WebKit (Chrome / Safari) location.href = "#"; location.href = "#myDiv";