Gossamer Forum
Home : General : Internet Technologies :

Javascript problem - document.getElementById(xxx).style.opacity)

Quote Reply
Javascript problem - document.getElementById(xxx).style.opacity)
function tabfade(targettab){
if(parseInt(document.getElementById(targettab).style.opacity) >= 0){
clearInterval(timerID1);
document.getElementById(targettab).style.opacity = parseInt(document.getElementById(targettab).style.opacity) - 0.1;
timerID1=setInterval(function(){tabfade(targettab);}, 10);
}
//document.write(parseInt(document.getElementById(targettab).style.opacity));
}

<a href="#" ONCLICK="tabfade('picc')"><img src="3.jpg" id="picc" STYLE="OPACITY:0.9;"></a>

#=================================================
#im going to build a website there is a pic,
#when u click the pic,
#the pic will fade off,
#but function "tabfade" is not working,
#and i find that
#"parseInt(document.getElementById(targettab).style.opacity)" cannot - 0.1 in javescript,
#any method?
#thx u~

Last edited by:

Ginkan: Oct 23, 2007, 12:29 PM