hyprland-website/public/js/smooth-view.js

11 lines
No EOL
318 B
JavaScript

const links = document.querySelectorAll(".like-this");
links.forEach((link) => {
link.addEventListener("click", (event) => {
event.preventDefault();
const targetId = link.getAttribute("href");
const target = document.querySelector(targetId);
target.scrollIntoView({ behavior: "smooth" });
});
});