Closed tno2007 closed 2 months ago
Hi @tno2007
Since v3.8.0, you can set a timeout period in milliseconds for the Defer.lazy variable to the waitForUserAction
argument. If no user interaction occurs within this timeout period, the scripts will still execute.
Your 3rd code may be like this.
Defer(update, 0, 1000);
View more in #131.
We can use the delay integer to defer code: https://codepen.io/tno2007/pen/WNqeEgp
We can also wait for user input, before we execute the code: https://codepen.io/tno2007/pen/OJeLjYR
But it does not seem like the library can use a combination of both together: (The custom code does not execute after the delay set. The page waits for user input) https://codepen.io/tno2007/pen/bGPbrPW
I'm not sure if this was the intention. But do you think you can add such functionality: (It executes your code whenever the delay is over, or whenever the user starts interacting with the site) https://codepen.io/tno2007/pen/PorYKMG