Reputation: 1
I have this code, and i would like to switch images using a set interval timer. Please help me, thanks!
Upvotes: 0
Views: 53
Reputation: 8354
in setInterval()
you need to pass function reference not call the function yourself.
use :
setInterval(changeImage,1000);
instead of
setInterval(changeImage(),1000);
Upvotes: 2