tags:

views:

92

answers:

2
var div=document.createElement("div");
div.innerHTML="<img src='load.gif'>";

With javascript.

+3  A: 

Make use of setTimeout().

Edit: I realize, isn't this a bit fake? Shouldn't you hide a load.gif when the loading task is actually finished? Using them for decoration only makes no sense.

BalusC
A: 

I would use jQuery for it so code is more elegant. Otherwise you could use setTimeout

var div=document.createElement("div");
div.innerHTML="<img src='load.gif'>";
setTimeout("div.innerHTML=''",5000);
rochal
if you minus please explain what is wrong with the code so I can improve.
rochal