I have a simple navigation menu linking to different parts of my page using an anchor tag like this
<a href="#section-2">Blabla</a>
The problem is that I have some JS fading the section in when opening the page but it's also triggered each time I click on the anchor. How to prevent this?
I don't want this, I want to execute my JS at page opening and do nothing (except going to the right section of the page) when clicking on anchor tag
The page is not reloading so I don't understand why this is happening.
Is it because of turbolinks ?
document.addEventListener('turbolinks:load', () => {
fadeoutImg();
fadeInText();
});
Thanks a lot!