Skip to content

Commit

Permalink
Fixes links
Browse files Browse the repository at this point in the history
  • Loading branch information
atteggiani committed Jul 10, 2023
1 parent 07839ab commit f44a7ad
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions docs/js/miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,12 @@ function adjustScrollingToId() {

const clickEvent = e => {
e.preventDefault();
console.log('ciao');
window.scrollTo(0, document.querySelector(e.target.hash).offsetTop - header.offsetHeight);
}

links.forEach(link => {
link.addEventListener('click', clickEvent)
})

// function adjustClick() {
// const clickEvent = (e) => {
// e.preventDefault();
// window.scrollTo(0, document.querySelector(e.target.hash).offsetTop - header.offsetHeight);
// }
// links.forEach(link => {
// link.removeEventListener('click', clickEvent);
// link.addEventListener('click', clickEvent);
// })
// }

// let observer = new ResizeObserver(entries => adjustClick());

// adjustClick();
// observer.observe(header);
}

// Join all functions
Expand Down

0 comments on commit f44a7ad

Please sign in to comment.