Problème images png dans IE 6
misscasa2009
Messages postés
71
Statut
Membre
-
Profil bloqué -
Profil bloqué -
Bonjour,
j'avais trouvé sur le forum un moyen pour afficher les images transparentes (.png) dans IE 6, on met un fichier pngfix.js qui contient le code suivant:
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
et dans ma page ou il y a les images, je met le code suivant:
<![if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]>
ça marche pour certaines images, et pour d'autres leur taille grandisse!! voilà le code pour ces images là:
<table border="0" height="8" align="center" cellpadding="0" width="900" cellspacing="0">
<tr height="8">
<td><img src="images/S2.png" height="8" width="10"></td>
<td bgcolor="#33b2d3" width="880"></td>
<td><img src="images/S1.png" height="8" width="10"></td>
</tr>
</table>
j'espère que j'étais pas longue!
merci si vous avez une solution!
j'avais trouvé sur le forum un moyen pour afficher les images transparentes (.png) dans IE 6, on met un fichier pngfix.js qui contient le code suivant:
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
et dans ma page ou il y a les images, je met le code suivant:
<![if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]>
ça marche pour certaines images, et pour d'autres leur taille grandisse!! voilà le code pour ces images là:
<table border="0" height="8" align="center" cellpadding="0" width="900" cellspacing="0">
<tr height="8">
<td><img src="images/S2.png" height="8" width="10"></td>
<td bgcolor="#33b2d3" width="880"></td>
<td><img src="images/S1.png" height="8" width="10"></td>
</tr>
</table>
j'espère que j'étais pas longue!
merci si vous avez une solution!
A voir également:
- Problème images png dans IE 6
- Nero 6 - Télécharger - Gravure
- Gta 6 trailer 2 - Guide
- Des images - Guide
- Bill ie cork ✓ - Forum Consommation & Internet
- 6 ampere = watt ✓ - Forum Matériel & Système