<?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>Just A Stupid Girl &#187; .png</title>
	<atom:link href="http://www.justastupidgirl.com/tag/png/feed" rel="self" type="application/rss+xml" />
	<link>http://www.justastupidgirl.com</link>
	<description>Putting the 'con' in conservative</description>
	<lastBuildDate>Wed, 14 May 2008 18:32:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The best .PNG transparancy fix for IE windows</title>
		<link>http://www.justastupidgirl.com/technical/the-best-png-transparancy-fix-for-ie-windows</link>
		<comments>http://www.justastupidgirl.com/technical/the-best-png-transparancy-fix-for-ie-windows#comments</comments>
		<pubDate>Fri, 20 Oct 2006 04:32:21 +0000</pubDate>
		<dc:creator>StupidGirl</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[.png]]></category>
		<category><![CDATA[IE hack]]></category>
		<category><![CDATA[webDev]]></category>

		<guid isPermaLink="false">http://www.justastupidgirl.com/?p=21</guid>
		<description><![CDATA[Ahh the .PNG. With it&#8217;s vast transparency support. Oh how I love you.  It opens up a whole new world of web designing possibilities&#8230;.with only one known enemy&#8230;.Internet Explorer when run on Windows.  
Here&#8217;s the deal. Since IE and Windows are the devil, they dont have full transparency support. So what do we [...]]]></description>
			<content:encoded><![CDATA[<p><span class="dropcap">Ahh the .PNG.</span> With it&#8217;s vast transparency support. Oh how I love you.  It opens up a whole new world of web designing possibilities&#8230;.with only one known enemy&#8230;.Internet Explorer when run on Windows.  <img src="http://www.justastupidgirl.com/wp-includes/images/stupid/rant.gif" class="wp-smiley" /></p>
<p>Here&#8217;s the deal. Since IE and Windows are the devil, they dont have full transparency support. So what do we do? Ignore the glorious world of the .PNG? Hell no!! We find a way around the failings of IE, as we so often have to do with css anyway.  I searched high and low and found many different fixes, tried them all, and now I&#8217;m sharing the simpliest, most effective one with you here. The author is Erik Arvidsson, and the nitty gritty details of this hack can be found <a href="http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html" target="_blank">HERE</a> as well as all the files you will need for it. I will explain how to use it in laymen&#8217;s terms here.</p>
<p>First, take the file named pngbehavior.htc and put it in the root directory of your site.<br />
<a class="quickcode" title="Code" href="javascript:toggleLayer('quickcode211');">pngbehavior</a></p>
<div id="quickcode211" class="quickcode"><code>&nbsp;&nbsp;* PNG Behavior<br />
*<br />
* This script was created by Erik Arvidsson (http://webfx.eae.net/contact.html#erik)<br />
* for WebFX (http://webfx.eae.net)<br />
* Copyright 2002-2004<br />
*<br />
* For usage see license at http://webfx.eae.net/license.html<br />
*<br />
* Version: 1.02<br />
* Created: 2001-??-??&nbsp;&nbsp;&nbsp;&nbsp;First working version<br />
* Updated: 2002-03-28&nbsp;&nbsp;&nbsp;&nbsp;Fixed issue when starting with a non png image and<br />
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switching between non png images<br />
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2003-01-06&nbsp;&nbsp;&nbsp;&nbsp;Fixed RegExp to correctly work with IE 5.0x<br />
*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2004-05-09&nbsp;&nbsp;When printing revert to original<br />
*<br />
*/<br />
&nbsp;<br />
var supported = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) &amp;amp;&amp;amp;<br />
navigator.platform == &quot;Win32&quot;;<br />
&nbsp;<br />
var realSrc;<br />
var blanksrc=&quot;blank.gif&quot; ;<br />
var isPrinting = false;<br />
&nbsp;<br />
if (supported) fixImage();<br />
&nbsp;<br />
function propertyChanged() {<br />
if (!supported || isPrinting) return;<br />
&nbsp;<br />
var pName = event.propertyName;<br />
if (pName != &quot;src&quot<img src="http://www.justastupidgirl.com/wp-includes/images/stupid/yahoo3.gif" class="wp-smiley" /> return;<br />
// if not set to blank<br />
if (!new RegExp(blankSrc).test(src))<br />
fixImage();<br />
};<br />
&nbsp;<br />
function fixImage() {<br />
// get src<br />
var src = element.src;<br />
&nbsp;<br />
// check for real change<br />
if (src == realSrc &amp;amp;&amp;amp; /\.png$/i.test(src)) {<br />
element.src = blankSrc;<br />
return;<br />
}<br />
&nbsp;<br />
if ( ! new RegExp(blankSrc).test(src)) {<br />
// backup old src<br />
realSrc = src;<br />
}<br />
&nbsp;<br />
// test for png<br />
if (/\.png$/i.test(realSrc)) {<br />
// set blank image<br />
element.src = blankSrc;<br />
// set filter<br />
element.runtimeStyle.filter = &quot;progid<img src="http://www.justastupidgirl.com/wp-includes/images/stupid/yahoo4.gif" class="wp-smiley" />XImageTransform.Microsoft.&quot; +<br />
&quot;AlphaImageLoader(src=&#039;&quot; + src + &quot;&#039;,sizingMethod=&#039;scale&#039<img src="http://www.justastupidgirl.com/wp-includes/images/stupid/yahoo3.gif" class="wp-smiley" />&quot;;<br />
}<br />
else {<br />
// remove filter<br />
element.runtimeStyle.filter = &quot;&quot;;<br />
}<br />
}<br />
&nbsp;<br />
function beforePrint() {<br />
isPrinting = true;<br />
element.src = realSrc;<br />
element.runtimeStyle.filter = &quot;&quot;;<br />
realSrc = null;<br />
}<br />
&nbsp;<br />
function afterPrint() {<br />
isPrinting = false;<br />
fixImage();<br />
}<br />
</code></div>
<p>Next, upload the blank.gif image to the same place, then all you have to do is add this small snippet of code to each page the .PNG image will appear on (if you have a header include you can put it there)&#8230;</p>
<div class="quickcodenoclick"><code><br />
&nbsp;<br />
&lt;style type=&quot;text/css&quot;&gt;img { behavior: url(&quot;pngbehavior.htc&quot<img src="http://www.justastupidgirl.com/wp-includes/images/stupid/yahoo3.gif" class="wp-smiley" />; }<br />
&nbsp;<br />
&lt;/style&gt;</code></div>
<p>Easy as pie!!!</p>
<p>Now you can do all sorts of cool varying transparency anti-aliased images on any color backgrounds, on any patterned backgrounds, etc. The possibilities are endless. Check out just one example <a href="http://www.justastupidgirl.com/png.html" target="_blank">HERE</a> &#8230;drag your browser window, resizing it, to see how the background image flows smooth behind all those curves and the handsome drop shadow. You can&#8217;t get that effect with a gif, suckas!</p>
<p>Without the hack, that image would appear as if its been highlighted in IE on Windows:<br />
<img src="http://www.justastupidgirl.com/images/pngono.gif" alt="crap" /><br />
SO not cool. <img src="http://www.justastupidgirl.com/wp-includes/images/stupid/whatever.gif" class="wp-smiley" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.justastupidgirl.com/technical/the-best-png-transparancy-fix-for-ie-windows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
