Pakic
September 24, 2024, 6:18am
2
Hey,
Anchor links work only on the same page. Currently it is not possible natively to link to an anchor which is on another page.
But on this thread, you can find some javascript solution that our customer managed to make it work. So you can try that.
Sure @Marcel , this should work (not tested though):
<script>
function smoothScrollTo(element, duration = 1200, offset = 100) {
const targetPosition = element.getBoundingClientRect().top - offset;
const startPosition = window.pageYOffset;
const distance = targetPosition - startPosition;
let startTime = null;
function animation(currentTime) {
if (startTime === null) startTime = currentTime;
const timeElapsed = currentTime - startTime;
const ease = ease…