D
Defacta
Hi!
This works fine with Firefox and Safari but with IE, IE tells me
Object required, here is the code:
var max = 100;
var min = 0;
var opacite=min;
up=true;
var IsIE=!!document.all;
var ThePic=document.getElementById("fact-content");
function fadePic(){
if (opacite<max && up){opacite+=3;}
if (opacite>min && !up){opacite-=3;}
if (opacite>=max){up=false;}
if (opacite<=min){up=true;}
IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("fact-
content").style.opacity=opacite/100;
document.getElementById('fact-content').value=opacite+"%"
}
setInterval(function(){fadePic();},50)
function Opacificateur(Obj,quantite) {
Obj.style.opacity = quantite/10;
Obj.style.filter = 'alpha(opacity=' + quantite*10 + ')';
}
The IE error is for that line:
IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("fact-
content").style.opacity=opacite/100;
What can I do ?
Thanks,
Vincent.
PS: fact-content is not image but a div like this:
<div id="fact-content" style="filter:alpha(opacity=100);-moz-opacity:
1; ">
Hello world !
</div>
This works fine with Firefox and Safari but with IE, IE tells me
Object required, here is the code:
var max = 100;
var min = 0;
var opacite=min;
up=true;
var IsIE=!!document.all;
var ThePic=document.getElementById("fact-content");
function fadePic(){
if (opacite<max && up){opacite+=3;}
if (opacite>min && !up){opacite-=3;}
if (opacite>=max){up=false;}
if (opacite<=min){up=true;}
IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("fact-
content").style.opacity=opacite/100;
document.getElementById('fact-content').value=opacite+"%"
}
setInterval(function(){fadePic();},50)
function Opacificateur(Obj,quantite) {
Obj.style.opacity = quantite/10;
Obj.style.filter = 'alpha(opacity=' + quantite*10 + ')';
}
The IE error is for that line:
IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("fact-
content").style.opacity=opacite/100;
What can I do ?
Thanks,
Vincent.
PS: fact-content is not image but a div like this:
<div id="fact-content" style="filter:alpha(opacity=100);-moz-opacity:
1; ">
Hello world !
</div>