You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
384 B
12 lines
384 B
const smoothLinks = document.querySelectorAll('.scroll_link');
|
|
for (let smoothLink of smoothLinks) {
|
|
smoothLink.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
const id = smoothLink.getAttribute('href');
|
|
|
|
document.querySelector(id).scrollIntoView({
|
|
behavior: 'smooth',
|
|
block: 'start'
|
|
});
|
|
});
|
|
};
|
|
|