A JavaScript utility for adding anchor links to page content.
Try it
<script src="https://cdn.jsdelivr.net/gh/AdrianVillamayor/Anchor-JS@main/src/anchor.min.js"></script>
<script src="/js/plugins/anchor.js"></script>
$('.anchor[data-anchor]').on("click", function(e) {
e.preventDefault();
let target = $(this).attr("data-anchor");
scrollToAnchor(target);
})
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.