Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/04/2010, 07:47
Avatar de davo3d
davo3d
 
Fecha de Ingreso: marzo-2009
Ubicación: cali , colombia
Mensajes: 59
Antigüedad: 15 años, 1 mes
Puntos: 0
Respuesta: problemas con imágenes PNG en Internet Explorer

utiliza CSS en la capa o div que contenga la imagen png.

crea un archivo en block de notas con el nombre de iepngfix.htc y ponle este codigo:


<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://www.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 = '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>


ubica el archivo dentro de la misma carpeta del archivo qeu estas manejando y a la capa o div de la imagen png que cargas le agregas este css:

Nombre del div {

behavior: url(iepngfix.htc);

}


ESTE CODIGO SE UTILIZA PARA CREAR COMPATIBILIDAD EN EL INTERNET EXPLORER Y MANEJAR IMAGENES PNG.

me comentas si te sirvio.
__________________
SABIO NO ES EL QEU RESPONDE SINO EL QUE HA PREGUNTADO MUCHO

Última edición por davo3d; 29/04/2010 a las 07:56