Click to See Complete Forum and Search --> : filters.alpha.opacity...


Grand Mamamouch
04-27-2005, 09:22 PM
Hi !

Could you explain me why, when i desinhibite
//objet.filters.alpha.opacity=taux*100
the function doesn't work any more ?

NB : i browse with Mozilla.

Thanks for ur help !

<!-- scroll_opacifier -->

<p
id="p"
style="margin-top:90%;margin-bottom:90%;"
>
yduftdund

<script type="text/javascript">

objet=document.getElementById('p')

function scroll_opacifier()
{
position=objet.offsetTop-document.body.scrollTop
taux=position/window.innerHeight

objet.style.MozOpacity=taux
objet.style.opacity=taux
//objet.filters.alpha.opacity=taux*100

setTimeout('scroll_opacifier()', 10)
}

scroll_opacifier()

</script>

Kor
04-28-2005, 04:39 AM
I don't sense what you need those 2 lines?

objet.style.opacity=taux
objet.filters.alpha.opacity=taux*100

Mozilla uses
object.style.MozOpacity = number // (floating number between 0 and 1)
IE uses
object.style.filter = 'alpha(opacity='+number+')'; // (integer number between 0 and 100)

That is all.

Grand Mamamouch
05-01-2005, 08:10 AM
Thanx for your answer !