<?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>thetransient &#187; Code</title>
	<atom:link href="http://www.thetransient.com/category/web-design/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetransient.com</link>
	<description>One designer's web design blog</description>
	<lastBuildDate>Wed, 12 May 2010 17:21:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Personal business card style website</title>
		<link>http://www.thetransient.com/personal-business-card-style-website/274/</link>
		<comments>http://www.thetransient.com/personal-business-card-style-website/274/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 03:39:56 +0000</pubDate>
		<dc:creator>Erik Phipps</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.thetransient.com/?p=274</guid>
		<description><![CDATA[I recently uploaded a very basic business card style website to www.erikphipps.com (which I forgot I even owned!). The idea came to me when a co-worker sent me a link to a one page website for one of the people behind Vimeo (and other websites). I did some research and found a whole bunch of [...]]]></description>
			<content:encoded><![CDATA[<p>I recently uploaded a very basic business card style website to <a href="http://www.erikphipps.com">www.erikphipps.com</a> (which I forgot I even owned!). The idea came to me when a co-worker sent me a link to a one page website for <a href="http://www.zachklein.com/">one of the people behind Vimeo</a> (and other websites). I did some research and <a href="http://www.designmeltdown.com/chapters/BusinessCard/">found a whole bunch of interesting business card sites</a>. My requirements were pretty simple:</p>
<ul>
<li>include multiple methods for contacting me</li>
<li>incorporate microformats</li>
<li>use clean, modern code that is flexible enough for quick styling</li>
<li>use progressive enhancement</li>
<li>create a strong design and organize intelligently</li>
<li>share a little something about myself</li>
</ul>
<p>It took me all day last Saturday to design and code, but I finished in time to enjoy a beer or two and watch a movie. Please take a look and and post your feedback. Be sure to dig under the hood as well if UI design is your sort of thing.</p>
<p>Please view the page at <a href="http://www.erikphipps.com/">www.erikphipps.com</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetransient.com/personal-business-card-style-website/274/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>z-index fixes are sometimes easier than you think</title>
		<link>http://www.thetransient.com/z-index-fixes-are-sometimes-easier-than-you-think/213/</link>
		<comments>http://www.thetransient.com/z-index-fixes-are-sometimes-easier-than-you-think/213/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 05:28:18 +0000</pubDate>
		<dc:creator>Erik Phipps</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[z-index]]></category>

		<guid isPermaLink="false">http://www.thetransient.com/?p=213</guid>
		<description><![CDATA[I ran into the dreaded IE7/IE6 z-index rendering bug today. I knew it was going to show its ugly head once I began troubleshooting the UI component I was working on, but little did I expect it to slide itself behind nearly every element it was supposed to cover! I contemplated a jQuery solution but [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into the dreaded IE7/IE6 z-index rendering bug today. I knew it was going to show its ugly head once I began troubleshooting the UI component I was working on, but little did I expect it to slide itself behind nearly every element it was supposed to cover! I contemplated a jQuery solution but the thought of targeting so many different elements made my head spin.</p>
<p>I started running the causes through my head; position is relative, IE 7, target layer opens below event element&#8230;and then it hit me! Simply position the layer above the event triggering element! It worked because everything above the relative container was rendered before it in the source html. It was like manually reversing the z-index with jQuery except, since it was going in reverse, the browser had stacked the items correctly! Luckily the component I was working on had both the space and design to accomodate such a solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetransient.com/z-index-fixes-are-sometimes-easier-than-you-think/213/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build HTML/CSS pages or components from the ground up</title>
		<link>http://www.thetransient.com/build-htmlcss-pages-or-components-from-the-ground-up/221/</link>
		<comments>http://www.thetransient.com/build-htmlcss-pages-or-components-from-the-ground-up/221/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 16:10:44 +0000</pubDate>
		<dc:creator>Erik Phipps</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.thetransient.com/?p=221</guid>
		<description><![CDATA[When building HTML/CSS pages or components, I usually follow specific steps in order to keep my code clean and concise. The trick is to start with the base foundation and then slowly drill your way down to the very smallest inline element. These steps aren&#8217;t set in stone of course, and I often mix things [...]]]></description>
			<content:encoded><![CDATA[<p>When building HTML/CSS pages or components, I usually follow specific steps in order to keep my code clean and concise. The trick is to start with the base foundation and then slowly drill your way down to the very smallest inline element. These steps aren&#8217;t set in stone of course, and I often mix things up due to extenuating circumstances.</p>
<ol>
<li>Create raw html code with only the most basic tags and high level block divisions. This step is important to finish first so that anytime after it is done, the markup can be passed on to a developer. Don&#8217;t add ANY CSS until you are done!</li>
<li>Start applying structural styles first to get the basic layout worked out.</li>
<li>Apply any background images on the high level structural elements and/or body.</li>
<li>Apply non-color styles such as padding, margins, font-size, to block level elements, then inline elements if necessary.</li>
<li>Apply final colors and finish any fine-tuning</li>
</ol>
<p>Also, don&#8217;t forget to test in all supported browsers after each step.<br />
]]></content:encoded>
			<wfw:commentRss>http://www.thetransient.com/build-htmlcss-pages-or-components-from-the-ground-up/221/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 sniffer using conditional comments</title>
		<link>http://www.thetransient.com/ie6-sniffer-using-conditional-comments/197/</link>
		<comments>http://www.thetransient.com/ie6-sniffer-using-conditional-comments/197/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 05:30:40 +0000</pubDate>
		<dc:creator>Erik Phipps</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[example]]></category>

		<guid isPermaLink="false">http://www.thetransient.com/?p=197</guid>
		<description><![CDATA[I needed a fail-proof Internet Explorer 6 JavaScript sniffer and it seemed like everything I Googled warned of possible scenarios where it could possibly not work. Then It struck me that since I only needed to detect one version of Internet Explorer I could make a very simple script using Internet Explorer&#8217;s conditional comments. I [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a fail-proof Internet Explorer 6 JavaScript sniffer and it seemed like everything I Googled warned of possible scenarios where it could possibly not work. Then It struck me that since I only needed to detect one version of Internet Explorer I could make a very simple script using Internet Explorer&#8217;s conditional comments.</p>
<p>I know what you are thinking, that JavaScript sniffers are outdated and go against all that is web standards. I agree. However, as IE6 fades into the past, isn&#8217;t it time we started ignoring instead of bending over backwards for its lack of standards support? This is where a JavaScript browser sniffer comes in!</p>
<p>Others have probably used this technique and expanded it to other versions of Internet Explorer as well. For this post, I am just going to discuss the IE6 version since it is very simple to expand it to all other versions of IE.</p>
<p>Drop this javascript snippet in a script tag in the head of your document:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> browserSniffer <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>isIE6 <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p>Then, inside an <a href="http://www.quirksmode.org/css/condcom.html">IE conditional comment</a> targeted at IE6, change the value of <strong>isIE6</strong> to &#8220;true&#8221;. Like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">browserSniffer <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>isIE6 <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p>What you end up with is a non-global variable that is always equal to <strong>false </strong>unless the browser is IE6, then it is <strong>true</strong>. You can then easily dis-invite IE6 to the web standards party!</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>browserSniffer.<span style="color: #660066;">isIE6</span> <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// fix some bug in IE6</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// Do something sweet in other browsers</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="/wp-content/examples/standalone-examples/ie6-conditional-comment-javascript-browser-sniffer.htm">Standalone example &#8211; IE6 conditional comment javascript browser sniffer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetransient.com/ie6-sniffer-using-conditional-comments/197/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to reduce FireBug&#8217;s memory usage</title>
		<link>http://www.thetransient.com/how-to-reduce-firebugs-memory-usage/176/</link>
		<comments>http://www.thetransient.com/how-to-reduce-firebugs-memory-usage/176/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 06:51:16 +0000</pubDate>
		<dc:creator>Erik Phipps</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Development tools]]></category>
		<category><![CDATA[FireBug]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.thetransient.com/?p=176</guid>
		<description><![CDATA[I love FireBug but one day it became a memory behemoth! It was consuming over 800k every hour or so of work. I did a little poking around and found that I had inadvertently set network monitoring, console logging and JavaScript debugging to be on by default. After a little digging, I found the tip [...]]]></description>
			<content:encoded><![CDATA[<p>I love <a title="FireBug" href="http://getfirebug.com/">FireBug</a> but one day it became a memory behemoth! It was consuming over 800k every hour or so of work. I did a little poking around and found that I had inadvertently set network monitoring, console logging and JavaScript debugging to be on by default. After a little digging, I found the tip below in the <a href="http://groups.google.com/group/firebug">FireBug Google Group</a> buried deep inside a lengthy thread.</p>
<p>Click on the <strong>Console </strong>tab to activate it, then click on the drop-down arrow and select <strong>Disabled </strong>from the drop-down menu. Repeat this for the <strong>Script </strong>tab and the <strong>Net </strong>tab. Now these three features will be disabled by default. When you want to use any one of them, simply activate them on a per-site basis by ticking the tab next to the appropriate feature and clicking the <strong>Apply settings for www.site.com</strong> button.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thetransient.com/how-to-reduce-firebugs-memory-usage/176/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unclutter your website with simple jQuery javascript show and hide</title>
		<link>http://www.thetransient.com/unclutter-your-website-with-simple-jquery-javascript-show-and-hide/110/</link>
		<comments>http://www.thetransient.com/unclutter-your-website-with-simple-jquery-javascript-show-and-hide/110/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 05:39:49 +0000</pubDate>
		<dc:creator>Erik Phipps</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[user interface design]]></category>

		<guid isPermaLink="false">http://www.thetransient.com/?p=110</guid>
		<description><![CDATA[Here&#8217;s a tip to reduce clutter on a page with lots of repeating links, icons and/or elements. Say you have a list of search results on your website and each result has many action icons and links. It isn&#8217;t necessary to have to links and icons visible at all times. The non-vital content can be [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a tip to reduce clutter on a page with lots of repeating links, icons and/or elements. Say you have a list of search results on your website and each result has many action icons and links. It isn&#8217;t necessary to have to links and icons visible at all times. The non-vital content can be hidden by default and only shown when the user hovers over the search result containing element.</p>
<p>Check out this <a href="/wp-content/examples/jQuery/post_110_unclutterExample.htm">hiding non-vital content example</a>.</p>
<p>The method for the example is very simple and can be accomplished with a small jQuery function and a single class assigned to each element we want to hide. This can of course be done with plain old javascript as well but I&#8217;ll use jQuery because it&#8217;s so darn easy.</p>
<p>Here is the jQuery code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//hide secondary content</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.secondaryContent&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;visibility&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// toggle secondary content items on hover</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#p110_showHideExample li&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.secondaryContent&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;visibility&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;visible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.secondaryContent&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;visibility&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;hidden&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now all we need to do is add the class &#8220;secondaryContent&#8221; to any element we want to be visible only when the user mouses over the containing element.</p>
<p>For example, here is the remove link html from the upper right corner of the example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;delete secondaryContent&quot;</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;#&quot;</span>&gt;</span>X<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thetransient.com/unclutter-your-website-with-simple-jquery-javascript-show-and-hide/110/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
