Bonjour,
j'utilise la fonction qui suit pour faire un effet d'opacité sur une image.
Cela fonctionne très bien sur tous les navigateurs mais j'ai un probleme avec firefox 2 sur mac : cela fais de gras ou d'empatement sur tous les textes de la pages html.
Quelqu'un aurait un idée ??
Avec par avance mes remerciements
<img src="images/vignettes/<?php echo $image;?>.gif" border="0" class="gradualshine" onmouseover="slowhigh(this)" onmouseout="slowlow(this)"/>
/* fichier js
function slowhigh(which2){
//imgobj=which2
imgobj = document.getElementById(which2)
browserdetect=imgobj.filters? "ie" : typeof imgobj.style.MozOpacity=="string"? "mozilla" : ""
instantset(50);
highlighting=setInterval("gradualfade(imgobj)",100)
}
function slowlow(which2){
imgobj = document.getElementById(which2)
cleartimer()
instantset(100)
}
function instantset(degree){
if (browserdetect=="mozilla"){
imgobj.style.MozOpacity=degree/100;
}
else if (browserdetect=="ie"){
imgobj.filters.alpha.opacity=degree;
}
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}
function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1){
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
}
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100){
cur2.filters.alpha.opacity+=10;
}
else if (window.highlighting){
clearInterval(highlighting)
}
}