<?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>rel=me &#187; reader</title>
	<atom:link href="http://rel.me/t/reader/feed/" rel="self" type="application/rss+xml" />
	<link>http://rel.me</link>
	<description>programming, objective-c, cocoa, iphone, c</description>
	<lastBuildDate>Wed, 01 Feb 2012 07:26:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Javascript IE PNG fix</title>
		<link>http://rel.me/2007/02/26/javascript-png-fix-for-ie/</link>
		<comments>http://rel.me/2007/02/26/javascript-png-fix-for-ie/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 02:33:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[greader]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[reader]]></category>

		<guid isPermaLink="false">/2007/09/03/javascript-png-fix-for-ie</guid>
		<description><![CDATA[I adapted the pngfix.js to be rails friendly. Not that I should be using image tags anyway. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 var arVersion = navigator.appVersion.split(&#34;MSIE&#34;); var version = parseFloat(arVersion[1]); if ((version &#62;= 5.5) &#38;&#38; (document.body.filters)) { var [...]]]></description>
			<content:encoded><![CDATA[<p>I adapted the <a href="http://homepage.ntlworld.com/bobosola/pnghowto.htm">pngfix.js</a> to be rails friendly. Not that I should be using image tags anyway.</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">var arVersion = navigator.appVersion.split(&quot;MSIE&quot;);<tt>
</tt>var version = parseFloat(arVersion[1]);<tt>
</tt><tt>
</tt>if ((version &gt;= 5.5) &amp;&amp; (document.body.filters)) {        <tt>
</tt>  var i;<tt>
</tt>  var length = document.images.length;<tt>
</tt>    for(i = 0; i &lt; length; i++) {<tt>
</tt>      var img = document.images[i];<tt>
</tt>      var re = /\w+\.[Pp][Nn][Gg]\w*/;<tt>
</tt>      if (img &amp;&amp; re.exec(img.src)) {<tt>
</tt>        var imgTitle = img.title ? &quot;title='&quot; + img.title + &quot;' &quot; : &quot;title='&quot; + img.alt + &quot;' &quot;;<tt>
</tt>        imgStyle = img.parentElement.href ? &quot;cursor:pointer;&quot; : &quot;&quot;;<tt>
</tt>        imgStyle += &quot;width:&quot; + img.width + &quot;px; height:&quot; + img.height + &quot;px;&quot;;<tt>
</tt>        imgStyle += &quot;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src=\'&quot; + img.src + &quot;\', sizingMethod='scale');&quot;;<tt>
</tt>                <tt>
</tt>        var strNewHTML = &quot;&amp;lt;span &quot; + imgTitle + &quot; style=\&quot;display:inline-block; &quot; + imgStyle + &quot; \&quot;&gt;&lt;/span&gt;&quot;;<tt>
</tt><tt>
</tt>        img.outerHTML = strNewHTML;<tt>
</tt>        i = i - 1;<tt>
</tt>    }<tt>
</tt>  }<tt>
</tt>}</pre>
</td>
</tr>
</table>
<p><a href="http://dclicio.us/javascripts/pngfix.js">download</a></p>
<p>Then add this somewhere in your &lt;head&gt;</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">&lt;!--[if lt IE 7]&gt;<tt>
</tt>&lt;script defer type=&quot;text/javascript&quot; src=&quot;/javascripts/pngfix.js&quot;&gt;&lt;/script&gt;<tt>
</tt>&lt;![endif]--&gt;</pre>
</td>
</tr>
</table>
<p>The only other requirement is you specify a width and height on your image_tags</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre><tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">&lt;<span class="s"><span class="dl">%=</span><span class="k"> image_tag(&quot;fam/date.png&quot;, :alt </span><span class="dl">=</span></span>&gt; <span class="s"><span class="dl">&quot;</span><span class="k">ical</span><span class="dl">&quot;</span></span>, <span class="sy">:width</span> =&gt; <span class="s"><span class="dl">&quot;</span><span class="k">16px</span><span class="dl">&quot;</span></span>, <span class="sy">:height</span> =&gt; <span class="s"><span class="dl">&quot;</span><span class="k">16px</span><span class="dl">&quot;</span></span>) %&gt;</pre>
</td>
</tr>
</table>
<p>Though you should use CSS for most images, this is a fast way to make your png&#8217;s work in IE6.</p>
]]></content:encoded>
			<wfw:commentRss>http://rel.me/2007/02/26/javascript-png-fix-for-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

