my anchor links do 3 different things:
- Sometimes nothing (click has no effect)
- Sometimes jump exactly to the wanted position
- Sometimes jump to a wrong position
What might be the reason for this behaviour?
The html looks like this:
<a class="i-footer-link" href="#ankeris">Link2</a></nav>
<p class="text">© 2023 xy</p>
The target IDs only exist once. It does not make a difference in which tag I put it (img, div, h, …)
Link to website?
Desktop or mobile (or both?)
Do you experience this issue on any other websites with anchor links?
(Try this site for example… https://protectinteriorservices.com/ )
Have you tried creating a new blank website and setting up some anchor links on a page just to see if it’s an issue with the particular website project?
Try opening the New Age website template included in BSS. This site uses anchor links. Preview the site in your browser and see if the links work correctly.
The 3 problems are on Win 11 and Chrome Browser.
Mobile (Android, Chrome) the links always “work” but go to the top of the website instead to the wanted position.
Project is not public at the moment.
I will test blank project tomorrow …
Going to the “top” is the typical the behavior of an unassigned anchor link. Are you quite sure your syntax is correct on all the components?
That’s true. It was a reload problem.But now:
- works perfect on Android Smartphone, Chrome
- works perfect on iphone 11, Safari and Chrome
- Problems are only on win 10 and win 11 (Chrome and Firefox)
Of course I emptied cache and reloaded.
Did you try this ^, and if so, did you still have issues? What about the link I gave you to my website?
New Age website template and protectinteriorservices.com have exactly the same problems.
For example on this page the anchor (“What are anchor links?”)works:
On this website for example the anchor (“Example of creating a jumping anchor link”) has also the same problems:
also not working correctly
All not working examples SCROLL to the target.
The working example JUMPS to the target.
For me it looks like a global problem on windows systems.
But how to fix it? How to deal with it?
To see the problem on protectinteriorservices.com for example.
• I press “Why sanitize your vehicle” Button
• Scroll back to the top of the site. Repress “Why sanitize …” Button
- click: Works
- click: works
- click: Nothing happens
- scrolls a few pixels and bounces back to the top
- works …“
Of course I did not test only on my own windows computer. I tried on different win 10 and win 11 machines. Chrome and Firefox.