<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>iuttu &#187; png</title> <atom:link href="http://www.iuttu.com/tag/png/feed/" rel="self" type="application/rss+xml" /><link>http://www.iuttu.com</link> <description>Desarrollo web</description> <lastBuildDate>Mon, 23 Jan 2012 16:52:04 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>IE7 y los PNG semi-transparentes</title><link>http://www.iuttu.com/2009/01/ie7-y-los-png-semi-transparentes/</link> <comments>http://www.iuttu.com/2009/01/ie7-y-los-png-semi-transparentes/#comments</comments> <pubDate>Fri, 02 Jan 2009 21:36:20 +0000</pubDate> <dc:creator>iuttu</dc:creator> <category><![CDATA[maquetación]]></category> <category><![CDATA[ie7]]></category> <category><![CDATA[png]]></category> <guid
isPermaLink="false">http://blog.iuttu.com/?p=99</guid> <description><![CDATA[Las ganas que teníamos todos de que llegase el soporte del formato de imagen PNG a Internet Explorer 7, y cuando llega, llega incompleto (viva Microsoft). El descubrimiento llega después de utilizar exhaustivamente mootools, haciendo aparecer de la nada capas con una imagen PNG, mientras se realiza el efecto se ve una sombra negra (depende [...]]]></description> <content:encoded><![CDATA[<p>Las ganas que teníamos todos de que llegase el soporte del formato de imagen <a
rel="external" href="http://es.wikipedia.org/wiki/Portable_Network_Graphics">PNG</a> a <a
rel="external" href="http://www.microsoft.com/spain/windows/downloads/ie/getitnow.mspx">Internet Explorer 7</a>, y cuando llega, llega incompleto (viva <a
rel="external" href="http://www.microsoft.com">Microsoft</a>). El descubrimiento llega después de utilizar exhaustivamente <a
rel="external" href="http://www.mootools.net">mootools</a>, haciendo aparecer de la nada capas con una imagen <a
rel="external" href="http://es.wikipedia.org/wiki/Portable_Network_Graphics">PNG</a>, mientras se realiza el efecto se ve una sombra negra (depende del <a
rel="external" href="http://es.wikipedia.org/wiki/Portable_Network_Graphics">PNG</a>) en la zona transparente de la imagen, hasta que se completa la animación con la opacidad máxima (100%).</p><p>Para no complicar el ejemplo y mostrar el problema de una forma más sencilla, vamos a usar un par de imágenes (gracias Arturito por tu colaboración) y el siguiente html:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> xml:<span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;es-ES&quot;</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;es-ES&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>iuttu Test<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=iso-8859-1&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/mootools.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
#test {
background: url(IMGP1355.JPG) no-repeat; width: 300px; height: 225px;
position: relative;
}
#test img {
position: absolute; top: 60px; left: 50px;
}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
function canviarOpacidad(_acual) {
$(&quot;foto&quot;).setStyle('opacity', _acual);
}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;test&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;foto&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;png.png&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">code</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:canviarOpacidad(0);&quot;</span>&gt;</span>opacidad = 0<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:canviarOpacidad(1);&quot;</span>&gt;</span>opacidad = 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:canviarOpacidad(.5);&quot;</span>&gt;</span>opacidad = .5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div><p>Podeis ver el ejemplo <a
href="http://blog.iuttu.com/wp-content/uploads/2008/12/png_opacity/png_test.html" rel="external">aquí</a>:</p><p>Bien, si pulsamos los dos primeros botones veremos que todo funciona de forma lógica (excepto en IE6, que no renderiza bien los PNGs de serie). Si pulsamos en opacidad cero la capa desaparece, y en opacidad uno la capa aparece, esto parece funcionar en IE7 que oculta y muestra la capa correctamente, pero, si pulsamos en opacidad .5, en IE7 parece que la capa se ve más oscura:</p><p><img
src="http://blog.iuttu.com/wp-content/uploads/2008/12/png_opacity/png_ie7.jpg" alt="Pantallazo ie7 png" /></p><p>En fin, ahora esperar a que alguien descubra una forma de evitar esto (parece que funciona si la capa que contiene el png tiene como fondo un color plano) o a que salga el IE8 y se pongan las pilas <img
src='http://www.iuttu.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> <img
src='http://www.iuttu.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.iuttu.com/2009/01/ie7-y-los-png-semi-transparentes/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 7/15 queries in 0.015 seconds using disk: basic

Served from: www.iuttu.com @ 2012-02-06 14:32:07 -->
