Reputation: 35
I am currently using this code to trigger an overlay:
<body onload="toggleOverlay();">
How do I delay this for a set time in milliseconds or seconds?
Upvotes: 1
Views: 1794
Reputation: 36
You can delay the execution of toggleOverlay() using setTimeout().
onload="setTimeout('toggleOverlay()', 1000);
When the page loads, the setTimeout is executed but not yet the toggleOverlay.
Upvotes: 1