ifvisible.js 兼容性解决方案:从 IE6 到现代浏览器的完整支持
2026/5/8 19:24:55
// 等待DOM更新后,将class的dom滚动到可视区域 setTimeout(() => { const activeMonthElement = document.querySelector('.month-text.active'); if (activeMonthElement) { activeMonthElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' }); } }, 0);