Hello RoSi!
Welcome to our forum and thanks for contacting us with your question!
It is hard to tell you what is not working and what could be done without taking look at your code. Could you reproduce the issue in an online editor that I could work on? You can find a basic template in the link below.
Demo:
https://jsfiddle.net/BlackLabel/0pbeym97/
Best regards!