![]() |
How to delay a setInterval - Java Script
I have an animation in Jquery that I want to repeat with a setInterval every 5 seconds, the problem is that I also want it to wait 5 seconds before starting. I have not find a solution, I thought about something like this but it is not working, it executes immediately:
setTimeout(function(){ bannerInterval = setInterval(function(){ bannerRotate(); },5000); },5000); |
To solve this problem you have to call settimeout function in the callback function of jquery of javascript with delay time.
|
All times are GMT -7. The time now is 11:46 PM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.