I figured out the problem. I applied the script to a section instead of a box. I also did what you suggested and it works now! Thanks for the help!
Is there a way to show it only after 10% scroll?
How can I make the content on the sticky bar stay put instead of moving when a screen is not at 100% zoom?