Delay javascript function

Hi Jonathan, I have something similar I'm trying to achieve here can you please take a look.