将当前class的dom,滚动到可视区域
2026/5/8 19:28:51 网站建设 项目流程
// 等待DOM更新后,将class的dom滚动到可视区域 setTimeout(() => { const activeMonthElement = document.querySelector('.month-text.active'); if (activeMonthElement) { activeMonthElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' }); } }, 0);

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询