gli Posted June 23, 2008 Share Posted June 23, 2008 Hi! First, im begginer to JavaScript. I have script that force opacity from max to nothing. I use two opacities, one for ie: opacity and css3 standard filter:alpha(opacity=x). All is ok with 'opacity' , but with second css3 standard is problem, i dont know if i add it right in my JavaScript because of continue after the word 'filter:' , first one is just simple 'opacity' So there is the code: var opacity2 = 100 function fadeout2() { if(opacity2 >= 1) { opacity2 = opacity2 - 10; document.getElementById('box2').style.filter='alpha(opacity=' + opacity2 + ')'; window.setTimeout('fadeout2()', 60); } else { document.getElementById('box2').style.visibility="active"; } } and here is code for 'opacity' which are working var opacity = 1 function fadeout() { if(opacity >= 0.1) { opacity = opacity - 0.1; document.getElementById('box2').style.opacity=opacity; window.setTimeout('fadeout()', 60); } else { document.getElementById('box2').style.visibility="hidden"; } } Thanks and sorry for my bad English. Quote Link to comment Share on other sites More sharing options...
gli Posted June 23, 2008 Author Share Posted June 23, 2008 omg. i just forgot to add event for fadeout2() function in html file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.