Dropdown Navigation Bar

I made a dropdown navigation bar using custom code (ex: https://codepen.io/taniarascia/pen/dYvvYv) and added it as an iframe to my project. However, when I try to click on the links, it says that my website refused to connect. Does anyone know how to fix this? Or have any alternative ways to make a dropdown navigation bar?