document.addEventListener("DOMContentLoaded", function() {
function scrollToHash() {
if (window.location.hash) {
var target = document.querySelector(window.location.hash);
if (target) {
setTimeout(function() {
target.scrollIntoView({ behavior: "smooth" });
}, 100); // Delay to ensure the page is fully loaded
}
}
}
scrollToHash(); // Initial call when the page loads
window.addEventListener("hashchange", function() {
scrollToHash(); // Call again if the hash changes
});
});