Ver Mensaje Individual
  #9 (permalink)  
Antiguo 23/01/2007, 14:09
yosi666
 
Fecha de Ingreso: noviembre-2006
Mensajes: 42
Antigüedad: 17 años, 4 meses
Puntos: 0
Re: .png en IE (novato). dónd está mi error?

Gracias nuevamente por la paciencia (no se desesperen, ahí vamos)
1.-Bhagat, lo que veo del código que me has escrito es que si mi index.htm detecta que el navegador es ie6 se activa el ie.css, pero yo no tengo creado un ie.css, que debería poner en este css???

2.-Mikmoro: he hecho algo que obviamente no es lo que tú decía por que sigo igual que siempre. Veo bien en FF, pero en ie6 imagen con fondo gris. Te comento lo que hice.
Creé un lugar nuevo de prueba donde tan sólo hubiese un index.htm con un png con transparencia y un fondo azul (ya que la transparencia es en blanco). También metí en la carpeta el iepngfix.htc (editando la línea del fondo en blanco) y en mi carpeta de "imagenes" quedan el png y el blank.gif. De manera que lo único que tengo es: index.htm, iepngfix.htc y la carpeta "imagenes" (con el png y el blank.gif). El código del index es como me dijiste, o eso creo:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "htt:w_w_w,w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="htt/w_w_w,w3.org/1999/xhtml">
<head>
  <meta content="text/html; charset=iso-8859-1"
 http-equiv="Content-Type" />
  <title>png para IE</title>
  <style type="text/css">
#uno img { position: absolute;
margin-top: -90px;
margin-left: -30px;
behavior: url(iepngfix.htc);
}
  body {
	background-color: #0000FF;
}
</style>
</head>
<body>
<img style="width: 200px; height: 120px;" alt=""
 src="imagenes/blancopng32.png" />
<div id="uno"></div>
</body>
</html>
y el codigo del iepngfix.htc :

Código:
<public:component>
<public:attach event="onpropertychange" onevent="doFix()" />

<script type="text/javascript">

// IE5.5+ PNG Alpha Fix v1.0RC4
// (c) 2004-2005 Angus Turnbull http:/w_w_w.twinhelix.com

// This is licensed under the CC-GNU LGPL, version 2.1 or later.
// For details, see: http:/creativecommons,org/licenses/LGPL/2.1/


// This must be a path to a blank image. That's all the configuration you need.
if (typeof blankImg == 'undefined') var blankImg = 'imagenes/blank.gif';


var f = 'DXImageTransform.Microsoft.AlphaImageLoader';

function filt(s, m)
{
 if (filters[f])
 {
  filters[f].enabled = s ? true : false;
  if (s) with (filters[f]) { src = s; sizingMethod = m }
 }
 else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
}

function doFix()
{
 // Assume IE7 is OK.
 if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
  (event && !/(background|src)/.test(event.propertyName))) return;

 var bgImg = currentStyle.backgroundImage || style.backgroundImage;

 if (tagName == 'IMG')
 {
  if ((/\.png$/i).test(src))
  {
   if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
    style.width = offsetWidth + 'px';
   filt(src, 'scale');
   src = blankImg;
  }
  else if (src.indexOf(blankImg) < 0) filt();
 }
 else if (bgImg && bgImg != 'none')
 {
  if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
  {
   var s = RegExp.$1;
   if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
    style.width = offsetWidth + 'px';
   style.backgroundImage = 'none';
   filt(s, 'crop');
   // IE link fix.
   for (var n = 0; n < childNodes.length; n++)
    if (childNodes[n].style) childNodes[n].style.position = 'relative';
  }
  else filt();
 }
}

doFix();

</script>
</public:component>
Ufff, a ver qué puede ser...