Hide a div when mouse is inactive for 5 seconds

Hi guys,

I have a quick question: How can I hide a div when mouse is inactive for 5 seconds then show div when clicked anywhere on the background. I can use interactions for the second part, show div when clicked, but the first one probably needs some custom code.

1 Like

Hi Andre
Did you find a solution for this?

What you need is a listener on your main page.

Make sure it listens to mouse move events and then if the events stop coming in, start a timer for 5 seconds. Once the 5 seconds are up, simply set visibility of div to invisible. Then the click should set it to visible again.

If you can show me some code, or a screenshot you tried to write, I will be able to help you.