• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Add images to the DOM after every 2 seconds

Resolved: Add images to the DOM after every 2 seconds

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am making a happy birthday website for a friend. I want to add images to the DOM after every 2s at a specific co-ordinates.
I have a setTimeout function in my script as follows :
The create balloon function is as follows :
I have all things ready… but when I put the setTimeout in an infinte loop, it prevents the page from loading.
Any clues how to do the task????

Answer:

Use setInterval function instead it will trigger each period of time.

If you have better answer, please add a comment about this, thank you!

infinite-loop javascript
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Resolved: How do I stop the command from happening if the requirements for it to work aren’t sert Discord.js

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.