


<?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>Repeat Penguin &#187; javascript</title>
	<atom:link href="http://www.repeatpenguin.com/tags/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.repeatpenguin.com</link>
	<description>website design : xhtml : css : mobile web ~ Delivered Repeatedly by Jeremy Anderson</description>
	<lastBuildDate>Tue, 17 Nov 2009 01:11:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>the tennis ball hack</title>
		<link>http://www.repeatpenguin.com/2008/03/15/the-tennis-ball-hack/</link>
		<comments>http://www.repeatpenguin.com/2008/03/15/the-tennis-ball-hack/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 20:15:02 +0000</pubDate>
		<dc:creator>Jeremy Anderson</dc:creator>
				<category><![CDATA[Distractions]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[keeping sane]]></category>

		<guid isPermaLink="false">http://www.repeatpenguin.com/2008/03/15/the-tennis-ball-hack/</guid>
		<description><![CDATA[
There are times when you wish there was a clean, elegant way to go about a thing and there are times, as we all know, when this just isn&#8217;t possible. Such, is my state of mind at present. We all know what it&#8217;s like to take something that is beautiful and clean, and have to [...]]]></description>
			<content:encoded><![CDATA[<p class="banner"><img src="http://www.repeatpenguin.com/img/20080315/banner.jpg" alt="tennis ball walker hack for web development" /></p>
<p>There are times when you wish there was a clean, elegant way to go about a thing and there are times, as we all know, when this just isn&#8217;t possible. Such, is my state of mind at present. We all know what it&#8217;s like to take something that is beautiful and clean, and have to bend and contort it to work in environments it really shouldn&#8217;t be subjected to. Such is the peril of the web designer and developer. And such is the profound necessity of standards.</p>
<p>In times like this, I can&#8217;t help but wish we, as designers and developers, had something for our practice, akin to the good old <a href="http://www.ehow.com/how_2083788_make-walker-glide-more-easily.html">tennis ball hack</a>.</p>
<p>Without a doubt, I&#8217;m ranting about Internet Explorer. I know, it&#8217;s a tiresome subject, but we, nevertheless, exhaust countless, valuable hours contending with the <em><a href="http://www.google.com/search?hl=en&#038;client=firefox-a&#038;rls=org.mozilla%3Aen-US%3Aofficial&#038;hs=Cpw&#038;q=where+IE6+went+wrong&#038;btnG=Search">legacy</a></em> Microsoft left behind.</p>
<p class="tr"><span id="more-65"></span></p>
<p>I won&#8217;t blame Microsoft, entirely, for the recent neglect I&#8217;ve shown this blog. I&#8217;ve been buried in the final preparations, for the launch of the colossal project I&#8217;ve been working on for the past months. At the end of this stretch, starting in October of last year, and after roughly a dozen meetings and 160 odd, independent email strings, I think it&#8217;s understandable how spending the last 5 hours and 15 minutes trying to figure out why Internet Explorer would not except <em><span class="p">&#8216;click&#8217;</span></em> events and in the end discovering a simple switch to a <em><span class="p">&#8216;mousedown&#8217;</span></em> event worked fine, had me little feathers, a wee bit ruffled.</p>
<p>Don&#8217;t get me wrong, I was ready to cry like a little girl when I happened upon this senseless solution, but I&#8217;m not the type to easily let things go, <em>not</em> understood. So is life with IE.</p>
<p>The funny thing in all this, is I couldn&#8217;t stop thinking about the brilliance of the tennis ball hack and how wonderful it would be for us developers facing off with Internet Explorer, if we had a similar, beautiful solution to IE short comings. The fact, however, is that <em>we</em> are the tennis balls to the IE walker, in this equation.</p>
<p>Unlike our gainful pursuits in web standards, the tennis ball hack has not enjoyed the same glint on the horizon. In fact, rather than improve the design of the walker, as to not require the cannibalized tennis ball, <a href="http://www.allegromedical.com/walkers-c516/drive-tennis-balls-glides-p554770.html">companies have bloomed</a> to capitalize on this age old hack and take something away from the masses and a stab at the beauty of accessibility.</p>
<p  class="center"><img src="http://www.repeatpenguin.com/img/20080315/drive.jpg" alt="tennis ball hack for walkers" /></p>
<p>Alas, the parallels with Internet Explorer and the web design community are uncanny. I digress. It&#8217;s a beautiful, chilly day in San Francisco and I am off to try to catch the end of <a href="http://www.preemptivemedia.net/">Preemptive Media&#8217;s</a> presentation on <a href="http://www.pm-air.net/index.php">Air</a>, at <a href="http://soex.org/index.html">Southern Exposure</a>. Enjoy the weekend, and if you have a chance, pick up a can of tennis balls just for fun. You never know when you might need to erase black scuff marks from the tile or rescue your keys from inside your locked car.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.repeatpenguin.com/2008/03/15/the-tennis-ball-hack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>friends of PNG</title>
		<link>http://www.repeatpenguin.com/2007/04/14/friends-of-png/</link>
		<comments>http://www.repeatpenguin.com/2007/04/14/friends-of-png/#comments</comments>
		<pubDate>Sat, 14 Apr 2007 17:57:18 +0000</pubDate>
		<dc:creator>Jeremy Anderson</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.repeatpenguin.com/2007/04/14/friends-of-png/</guid>
		<description><![CDATA[Alpha PNG Backgrounds in IE

In the process of redesigning a site for a client, I stumbled into my long lost, woeful friend PNG. Actually, I shouldn&#8217;t be so hard on PNG. We all know who&#8217;s fault it really is. There are a ton of sources out there, offering solutions for the IE bug, but I [...]]]></description>
			<content:encoded><![CDATA[<h2>Alpha PNG Backgrounds in IE</h2>
<p class="center"><img alt="cross browser variable opacity with PNG" class="nb" src="http://www.repeatpenguin.com/img/20070413/code.jpg" /></p>
<p>In the process of redesigning a site for a client, I stumbled into my long lost, woeful friend PNG. Actually, I shouldn&#8217;t be so hard on PNG. We all know who&#8217;s fault it really is. There are a ton of <a href="http://www.google.com/search?q=+iE+transparent+png+fix&#038;ie=utf-8&#038;oe=utf-8&#038;aq=t&#038;rls=org.mozilla:en-US:official&#038;client=firefox-a">sources</a> out there, offering solutions for the IE bug, but I needed something a little more comprehensive and involved a little less leg work.</p>
<p>My research led me to numerous sites, offering solutions to my PNG woes. Most of which either built upon or reiterated the <a href="http://www.alistapart.com/articles/pngopacity/">techniques</a> <a href="http://www.lovitt.net/">Michael Lovitt</a> discussed in <a href="http://www.alistapart.com/articles/pngopacity/">this article</a>, way back in the day.</p>
<p>For all the of the progress we&#8217;ve seen with IE7 (which <em>DOES</em> support transparent PNGs), we&#8217;re still left with the fact that it&#8217;s just a carrot dangling on a stick for a while more. We still have to deal with its predecessor and thus, I needed a clean solution that would do the leg work for me.</p>
<h3>Ping back PNG forward</h3>
<p class="center"><img alt="transparent PNGs for hidden divs" src="http://www.repeatpenguin.com/img/20070413/popdiv.jpg" /></p>
<p>To start with, there is a very simple solution to get IE6 to properly render transparent PNGs, using the <a href="http://msdn.microsoft.com/workshop/author/filter/reference/filters/alphaimageloader.asp">Microsoft AlphaImageLoader</a>. For simple tasks, I prefer to do this strictly using CSS and an IE6 conditional statement.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* IE6 PNG transparency FIX {--MEH!--} ----*/</span>
<span style="color: #00AA00;">*</span> html <span style="color: #cc00cc;">#nav</span> ul li <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
filter<span style="color: #00AA00;">:</span> progid<span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span><span style="color: #6666ff;">.AlphaImageLoader</span> »
<span style="color: #00AA00;">&#40;</span>src<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;http://www.domain.com/img/myPNG.png&quot;</span><span style="color: #00AA00;">,</span> »
sizingMethod<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;scale&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p class="quote">(Line wraps are marked <span class="linewrap">»</span> <em>-Ed</em>)</p>
<p class="clear">This method of handling PNGs usually does the trick, for simple application. It&#8217;s concise and easy to implement. On an individual basis, it&#8217;s perfect. I should mention, there are two ways you can define your sizingMethod. The first, &#8220;scale&#8221; (shown above), is perfect for some repeating background images. There is a drawback. It works great for 1px by 1px images and 1px images for x or y repeats, but for tiling images you get some unappealing distortion happening. The other value for sizingMethod is &#8220;crop&#8221;. This is for non-repeating background images.</p>
<h3>the All-Around PNG</h3>
<p>This time, however, I needed something that would do a little more of the leg work for me. I needed something that would handle all of my PNGs at once. I stumbled across <a href="http://www.flopidesign.com/2006/05/26/transparent-pngs-used-as-css-background-images-in-internet-explorer/">this article</a> by <a href="http://www.flopidesign.com">John Labriola</a>, which proved to be the best solution for my needs. He worked off of a solution Drew, of <a href="http://allinthehead.com/retro/69">All in the Head</a> and came up with a stream lined approach, using minimal JavaScript. <a href="http://www.flopidesign.com/2006/05/26/transparent-pngs-used-as-css-background-images-in-internet-explorer/">Check it out</a>.</p>
<p>Based on <a href="http://allinthehead.com/retro/289/sleight-update-alpha-png-backgrounds-in-ie">sleight</a> he uses a simple function that loops through document.all to find all of your background PNGs and fix them. You can download his updated version of <a class="download" href="http://www.repeatpenguin.com/scripts/bgsleight.js">bgsleight.js</a> here.</p>
<h3>Better dropdowns and hidden divs, using transparent PNGs</h3>
<p class="center"><img alt="transparent PNG for drop menu" src="http://www.repeatpenguin.com/img/20070413/dropdown.jpg" /></p>
<p>Now you&#8217;ve got all you need to make sexy dropdowns, hidden divs, icons and whatever else you come up with.<code></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.repeatpenguin.com/2007/04/14/friends-of-png/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
