Skip to content
Advertisement

Tag: wait

Wait until setInterval() is done

I would like to add a small dice-rolling effect to my Javascript code. I think a good way is to use the setInterval() method. My idea was the following code (just for testing): Now I would like to wait for the setInterval until it is done. So I added a setTimeout. This code works quite okay. But in my main

Waiting for image to load in JavaScript

I’m making an Ajax call which returns me some info including an image path. I prepare all this information in my HTML which will be displayed as a kind of popup. I just toggle the visibility of by popup div from hidden to visible. To set the position of my popup div, I have to calculate depending on the height

Advertisement