I need the effect to pause once the document.hidden = true and resume once document.hidden = false. I can't seem to get a handle on this as it runs while the document isn't being viewed and slowing down the browser especially if typewriting for a long time. I tried using document.addEventListener("visibilitychange") and had no luck. Thanks!
I need the effect to pause once the
document.hidden = trueand resume oncedocument.hidden = false. I can't seem to get a handle on this as it runs while the document isn't being viewed and slowing down the browser especially if typewriting for a long time. I tried usingdocument.addEventListener("visibilitychange")and had no luck. Thanks!