34565-vm/assets/js/main.js
Flatlogic Bot 6e7a1d506c version 1
2025-10-01 16:09:01 +00:00

17 lines
573 B
JavaScript

// assets/js/main.js
document.addEventListener('DOMContentLoaded', function () {
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const targetId = this.getAttribute('href');
const targetElement = document.querySelector(targetId);
if(targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth'
});
}
});
});
});