Sry for my late reply, but I had some other projects I had to take care of…
I want to use this scroll function for a repeater, so I can’t put the custom elm under the repeater, because if I do, the site scrolls to the last entry of the repeater.
Is there a way to put the element over the repeater? The code is only working, if the elm is under the repeater.