-
Posts
38 -
Joined
-
Last visited
Reputation Activity
-
victory_over_all got a reaction from tuanphan in Anchor links not working on Safari
@tuanphan Thank you! It works 🥳🌟🎉
I added the exact code above to the footer, in a Markdown Block, as described. Tested immediately in Safari on macOS, and it worked 👍
For some reason I thought that adding JavaScript wasn't possible in sites on a Personal Plan, even in Markdown blocks. No idea why I've thought that for so long, it's great to see that it's possible!
-
victory_over_all reacted to tuanphan in Anchor links not working on Safari
You can edit Site Footer > Add a Markdown Block > Use this code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(() => { function scrollToAnchor(aid){ var aTag = $(aid); $('html,body').animate({scrollTop: aTag.offset().top},'slow'); } scrollToAnchor(location.hash); }) </script>