// 锚点跳转 by ID
export function ScrollToAnchor(anchorName) {
if (anchorName) {
const anchorElement = document.getElementById(anchorName);
if (anchorElement) {
anchorElement.scrollIntoView({
block: 'start', behavior: 'auto'
});
}
}
}
// 锚点跳转 by ID
export function ScrollToAnchor(anchorName) {
if (anchorName) {
const anchorElement = document.getElementById(anchorName);
if (anchorElement) {
anchorElement.scrollIntoView({
block: 'start', behavior: 'auto'
});
}
}
}
本文标题:scrollIntoView
本文链接:https://www.haomeiwen.com/subject/vkciuqtx.html
网友评论