Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Javascript (http://siteownersforums.com/forumdisplay.php?f=24)
-   -   How to delay a setInterval - Java Script (http://siteownersforums.com/showthread.php?t=65248)

Jack Hard 05-30-2013 10:19 PM

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);

kashifalijugnoo 10-23-2013 05:40 AM

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.