<?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>Michael Forbes - User Experience Engineer &#187; Internet Explorer Hacks</title>
	<atom:link href="http://mrforbes.com/blog/category/internet-explorer-hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://mrforbes.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 15:53:38 +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>Fading PNGs in Internet Explorer 7 and 8</title>
		<link>http://mrforbes.com/blog/2009/10/fading-pngs-in-internet-explorer-7-and-8/</link>
		<comments>http://mrforbes.com/blog/2009/10/fading-pngs-in-internet-explorer-7-and-8/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 20:08:47 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Internet Explorer Hacks]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://www.mrforbes.com/?p=166</guid>
		<description><![CDATA[How to get rid of that annoying black background on PNGs that change opacity in IE8 <a href="http://mrforbes.com/blog/2009/10/fading-pngs-in-internet-explorer-7-and-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One issue I recently came across was the desire to use PNGs as the background of a tooltip, and to fade the tooltip in and out of view (you can see the functionality <a href="http://catalog.bocajava.com/coffee/coffee">here</a> by hovering over &#8216;details&#8217; or clicking on &#8216;buy now&#8217;).<br />
<span id="more-166"></span><br />
 In case you haven&#8217;t tried this before &#8211; IE7 and IE8 generally do not react well to fading PNGs, putting a black background under the portions of the PNG which have alpha transparency &#8211; and generally making the element look less than ideal.</p>
<p>Luckily, there is a fairly easy workaround for this situation as long as you are not trying to do too much with the pngs.  It will even fix pngs in IE6 for you too (in fact, that is the real purpose of the script).   That workaround is the jQuery ifixpng2 plugin, written by Yereth and available <a href="http://plugins.jquery.com/project/iFixPng2">here</a>.</p>
<p>All you need to do is install the plugin and use it on the PNG containing objects (images or backgrounds) that you would like to fade.  There are two changes you will need to make however:</p>
<p>Line 64 looks like this:</p>
<pre lang="php">ltie7	: $.browser.msie &amp;&amp; $.browser.version &lt; 7</pre>
<p>You&#8217;ll want to change the 7 to a 9 (in hopes that this is fixed for good by IE 9, otherwise you&#8217;ll need to go back and change it to 10 later).</p>
<p>The other change you need to make is on Line 149, which looks like this:</p>
<pre lang="php">for (prop in expr) elem.style.setExpression(prop, expr[prop], 'JavaScript');</pre>
<p>Internet Explorer 8 doesn&#8217;t support setExpression, so it will throw an error, unless you add an if statement to keep it from running:</p>
<pre lang="php">if( $.browser.msie &amp;&amp; $.browser.version &lt; 8 ) {
for (prop in expr) elem.style.setExpression(prop, expr[prop], 'JavaScript');
}</pre>
<p>That&#8217;s all there is to it.  Happy fading!</p>
]]></content:encoded>
			<wfw:commentRss>http://mrforbes.com/blog/2009/10/fading-pngs-in-internet-explorer-7-and-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

