How to execute delayed JavaScript after n seconds?
-
I am using the Litespeed Cache plugin on my WordPress website (https://www.theidioms.com). And I’ve enabled delayed JavaScript. It works well, and JS doesn’t get executed until the user interacts.
But I also want to execute the JS after n seconds, along with the current event of user interaction, whichever occurs earlier.
In my case, I want to delay JS by a maximum of 4 seconds if the user doesn’t interact. Because within 2 seconds, my page was fully loaded. This feature is available with the third-party plugin Flying Scripts.
How can I achieve this with Litespeed without going with other plugins?
I look forward to your kind cooperation.
Thanks and best regards,
Team Theidioms.comThe page I need help with: [log in to see the link]
- The topic ‘How to execute delayed JavaScript after n seconds?’ is closed to new replies.