Page 1 sur 1

Clignotement sous Firefox et sous IE

Publié : 11 mars 2005, 19:28
par Captain Caverne
Bonjour à tous, le code qui suit fait clignoter une image et du texte. Sous Firefox, tout fonctionne, sous IE, seule l'image clignote, le texte reste fixe, je ne comprends pas pourquoi.

Quelqu'un peut-il m'aider ? Merci d'avance.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document sans nom</title>
<style>
.opacity0 {opacity:0.0;filter:Alpha(Opacity=00) ;}
.opacity10 {opacity:0.1;filter:Alpha(Opacity=10) ;}
.opacity20 {opacity:0.2;filter:Alpha(Opacity=20) ;}
.opacity30 {opacity:0.3;filter:Alpha(Opacity=30) ;}
.opacity40 {opacity:0.4;filter:Alpha(Opacity=40) ;}
.opacity50 {opacity:0.5;filter:Alpha(Opacity=50) ;}
.opacity60 {opacity:0.6;filter:Alpha(Opacity=60) ;}
.opacity70 {opacity:0.7;filter:Alpha(Opacity=70) ;}
.opacity80 {opacity:0.8;filter:Alpha(Opacity=80) ;}
.opacity90 {opacity:0.9;filter:Alpha(Opacity=90) ;}
.opacity100 {opacity:1.0;filter:Alpha(Opacity=100);}
</style>

<script>
function clignote()
{
var list=document.getElementsByTagName("code");
var currentObj=null;
for(var i=0; i<list.length; i++)
{
currentObj=list.firstChild;
if(typeof currentObj.opacity=="undefined" || currentObj.opacity==100)
{
currentObj.opacity=0;
currentObj.className="opacity20";
}
else
{
currentObj.opacity=100;
currentObj.className="opacity100";
}
}
}
</script>
</head>

<body>
<table width="200" border="0" align="center" cellspacing="1">
<tr>
<td><div align="center"><code><img src="PhotoSeule.gif"></code></div></td>
<td><div align="center"><code><a>Test</a></code></div></td>
</tr>
</table>
<script>setInterval("clignote()",250);</script>
</body>
</html>

Publié : 14 mars 2005, 13:23
par Benoit
Parce que les filtres IE ne fonctionnent pas très bien (j'ai notamment des problèmes de sélection sur un site dont je m'occupe), et apparemment uniquement sur les images.

Au fait, si je puis me permettre, c'est une mauvaise idée de vouloir faire clignoter du texte. Ce n'est pas pour rien que la balise blink n'a jamais été acceptée par IE ;)

Publié : 14 mars 2005, 13:57
par HP
Benoit a écrit :Au fait, si je puis me permettre, c'est une mauvaise idée de vouloir faire clignoter du texte. Ce n'est pas pour rien que la balise blink n'a jamais été acceptée par IE ;)
si l'effet se limite à une décoration limitée ...
ça peut avoir son "charme"

Publié : 17 mars 2005, 15:41
par Blustuff
Ne faudrait il pas plutôt utiliser le membre visibility des objets pour faire clignoter ?