Hello, I’m trying to make some text get lighter in only 300ms. I have succeded doing 10 lines of window.setTimeout(document.getElementById(‘text’).style.MozOpacity=0.9,20), window.setTimeout(document.getElementById(‘text’).style.MozOpacity=0.8,40) and so on..
However I can’t make this work using a for-loop. Here’s my code:
[code=html]function go() {
var div=document.getElementById(‘text’);
var no=1.0;
var time=20;
for(var i=10;i>10;i–) {
window.setTimeout(‘div.style.MozOpacity=no’,time);
no=no-0.1;
time=time+20; } }
The only thing I get is always the same black text. If anyone can suggest me a better form of doing this, I’ll be very grateful.