在线留言

如果您有任何问题或建议,请留言给我们,我们会尽快回复您!

请勿在留言中包含链接、网址或HTML代码
返回首页
document.addEventListener('DOMContentLoaded', function() { // 平滑滚动 document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth' }); } }); }); // 导航栏激活状态 const currentLocation = location.pathname; const navLinks = document.querySelectorAll('.navbar-nav .nav-link'); navLinks.forEach(link => { if (link.getAttribute('href') === currentLocation) { link.classList.add('active'); } else { link.classList.remove('active'); } }); }); (function() { // 获取当前页面URL var currentUrl = window.location.href; // 发送统计请求 var xhr = new XMLHttpRequest(); xhr.open('POST', '/api/statistics/track', true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.send('url=' + encodeURIComponent(currentUrl)); })();