Do you have any live links that I could visit and try this out with? I’m curious if there’s either some javascript errors creeping in that may be contributing, or if there are other components on the page causing need to adjust and calculate a different offset to use with. For example the sticky header very likely could be playing its own part in this.
I know we have examples of the Admin bar from WP needing some offset, but that’s also for logged in users, not necessarily most standard site traffic.
Thread Starter
pako69
(@pako69)
Just to confirm, it’s a case of when clicking on say Éditeur du site you’re seeing:
https://cloudup.com/cZpwEyWPd2e
instead of
https://cloudup.com/cu2Bqcg_wkh
Hmm. The values and everything are getting set properly. Just out of curiosity, have you tried some outlandish amount of offset like 500 or more and tried to see if that had any effect?
Not seeing any js errors with this so I don’t think it’s that going on. Possibly some CSS affecting the results?
Thread Starter
pako69
(@pako69)
Yes I tried with 900px and it does nothing.
BUT…
At the top of this page: https://www.gmao.com/gestion-maintenance/ you will see 6 links. Those links are standards links made by myself > it works
On the other hand, in this page https://www.gmao.com/mentions-legales/ the links of the table of contents are not made by myself, it’s an Elementor widget (https://elementor.com/help/table-of-contents-pro/) that generates the links itself > it do not work
It’s an Elementor issue and I solved it by addis this CSS:
.elementor-menu-anchor {
top: -75px;
position: relative;
}
Source: https://github.com/elementor/elementor/issues/9947
Interesting. So it’s more an odd conflict with Elementor than anything else.
At least at the moment, you have a working solution too.