var d1= document.getElementById(‘显示内容区id值’);
d1.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' });
behavior值:
定义缓动动画, "auto", "instant", 或 "smooth" 之一。默认为 "auto"。
block:
"start", "center", "end", 或 "nearest"之一。默认为 "center"。
inline:
"start", "center", "end", 或 "nearest"之一。默认为 "nearest"。