I have encountered an issue with my website while trying to add a "back to top" feature. I have spent the entire day trying to fix it, but unfortunately, I haven't been able to find a solution. I am hoping that someone here can lend me a hand.
Problem: When the page is loading, everything functions properly except for the "back to top" button. However, when I refresh the page, the button appears. This is quite irritating because every time I visit the page, I have to refresh it to see the "back to top" feature.
I obtained the "back to top" feature from this source:
Is there a way to prevent this issue?
Edit 1-2: Test page --> --> choose Menu and scroll down. Then refresh the page to see the problem. It appears right after the refresh.
Edit 3: I have followed this tutorial here:
I added a link to the bottom of Menu.php
<a href="#" class="back-to-top">Back to top <img src="back.gif"> </a>"
I added the script and CSS file. That's all I have done.