Any way to prevent floating menu from restarting when I close and open the lid?

I have an html timer going in my floating menu, it resets when I close and open the lid.

Would really help me if it automatically gets paused while the lid is closed.

Can this be done?

What exactly do you mean by "resets"?

To keep it active while the floating menu is hidden check this option:

In case you have the "Restart BTT after wake from sleep" option active, make sure to disable that

If you need to execute Java Script to pause it, you can do it like this:

wow, didn't expect such quick response. You guys are really amazing!

Thanks it worked.