I use javascript to change the contents of a div every 5 seconds with another image. It simply picks a random image and then uses .innerHTML to change the div's content to the correct tag. But, when it loads the script, the image is changed but the whole page flickers a bit very shortly. Is the use of .innerHTML causing that? If so, how could I change the image in a div with javascript? Thanks!
Edit: Multiple suggestions from you were spot on: a height was missing, overmore it inserts a new img every time. I fixed it with a display:inline
and change the img src
instead of .innerHTML
. Again thanks everyone!