I have a setInterval function like below on a Divbox so if I leave a divbox, this setInterval is triggered:
setInterval("playthis()", 1000);
What I want it to do: If I leave the divbox and lets say within the next 2 second rehover it, the setInterval should not triggered.
Is this possible?
You can use cousins
setTimeoutandclearTimeoutto set a function callback that invokes yoursetIntervalonly after 2 uninterrupted seconds:You will want much better variable/function names than this though.