<?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>Clayton McIlrath &#187; JS</title>
	<atom:link href="http://thinkclay.com/tag/js/feed" rel="self" type="application/rss+xml" />
	<link>http://thinkclay.com</link>
	<description>Creative Media Design, Powered by Wordpress</description>
	<lastBuildDate>Thu, 29 Jul 2010 18:35:08 +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>FBJS Slider Carousel</title>
		<link>http://thinkclay.com/tutorial/fbjs-slider-carousel</link>
		<comments>http://thinkclay.com/tutorial/fbjs-slider-carousel#comments</comments>
		<pubDate>Tue, 13 Apr 2010 04:50:25 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[FBJS]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<guid isPermaLink="false">http://thinkclay.com/?p=1325</guid>
		<description><![CDATA[I&#8217;ve made a nice little FBJS Slider that I use quite often for animation within facebook. I hope that little snippets and code like this will help other developers make more interested and appealing Facebook applications, like we do at Room 214 currently. First with the styling #slideWrap creates an extremely wide canvas for the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a nice little <strong>FBJS Slider</strong> that I use quite often for animation within facebook. I hope that little snippets and code like this will help other developers make more interested and appealing Facebook applications, like we do at <a href="http://room214.com">Room 214</a> currently.</p>
<h3>First with the styling</h3>
<p>#slideWrap creates an extremely wide canvas for the slide to fit on aligned horizontally.<br />
#wrapper then creates a sort of viewport to view the slides through.</p>
<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">520px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#slideWrap</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">9000px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.slide</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">520px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#wrapper</span> <span style="color: #cc00cc;">#slideNav</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-2.75em</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#slideNav</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
		<span style="color: #cc00cc;">#slideNav</span> li a <span style="color: #00AA00;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">http://cmcilrath.rssready.net/xcel/assets/images/bg_slideNav.png?v=3</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">-12px</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">.5em</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-999em</span><span style="color: #00AA00;">;</span>
			<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
		<span style="color: #00AA00;">&#125;</span>
		<span style="color: #cc00cc;">#slideNav</span> li a<span style="color: #6666ff;">.next</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#slideNav</span> li a<span style="color: #6666ff;">.prev</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
		<span style="color: #cc00cc;">#slideNav</span> li a<span style="color: #6666ff;">.selected</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-12px</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
		<span style="color: #cc00cc;">#slideNav</span> li<span style="color: #cc00cc;">#prevSlide</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
		<span style="color: #cc00cc;">#slideNav</span> li<span style="color: #cc00cc;">#prevSlide</span> a<span style="color: #6666ff;">.disabled</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
		<span style="color: #cc00cc;">#slideNav</span> li<span style="color: #cc00cc;">#nextSlide</span> a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
		<span style="color: #cc00cc;">#slideNav</span> li<span style="color: #cc00cc;">#nextSlide</span> a<span style="color: #6666ff;">.disabled</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">bottom</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>
<h3>The FBJS script</h3>
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span>
<span style="color: #003366; font-weight: bold;">function</span> Each<span style="color: #009900;">&#40;</span>array<span style="color: #339933;">,</span> block<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> l <span style="color: #339933;">=</span> array.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>l<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		block<span style="color: #009900;">&#40;</span>array<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> currentSlide <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> maxSlides <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> animating <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> slideWidth <span style="color: #339933;">=</span> <span style="color: #CC0000;">520</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> currentPX <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> nextSlide<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> nextSlideNum <span style="color: #339933;">=</span> currentSlide <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>nextSlideNum <span style="color: #339933;">&gt;=</span> maxSlides<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'next'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>nextSlideNum <span style="color: #339933;">==</span> <span style="color: #CC0000;">2</span> <span style="color: #339933;">&amp;&amp;</span> currentSlide <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prev'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	currentSlide <span style="color: #339933;">=</span> nextSlideNum<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>animating <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> prevSlide<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> prevSlideNum <span style="color: #339933;">=</span> currentSlide <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>prevSlideNum <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prev'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentSlide <span style="color: #339933;">==</span> maxSlides<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'next'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	currentSlide <span style="color: #339933;">=</span> prevSlideNum<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>animating <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> toggleButton<span style="color: #009900;">&#40;</span>button<span style="color: #339933;">,</span>state<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>button <span style="color: #339933;">==</span> <span style="color: #3366CC;">'next'</span> <span style="color: #339933;">&amp;&amp;</span> state <span style="color: #339933;">==</span> <span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nextSlide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setInnerXHTML</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;#&quot; class=&quot;next disabled&quot;&gt;next slide &amp;gt;&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>nextSlide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>button <span style="color: #339933;">==</span> <span style="color: #3366CC;">'next'</span> <span style="color: #339933;">&amp;&amp;</span> state <span style="color: #339933;">==</span> <span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'nextSlide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setInnerXHTML</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;#&quot; class=&quot;next&quot;&gt;next slide &amp;gt;&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>nextSlide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>button <span style="color: #339933;">==</span> <span style="color: #3366CC;">'prev'</span> <span style="color: #339933;">&amp;&amp;</span> state <span style="color: #339933;">==</span> <span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prevSlide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setInnerXHTML</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;#&quot; class=&quot;prev disabled&quot;&gt;&amp;lt; previous slide&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>prevSlide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>button <span style="color: #339933;">==</span> <span style="color: #3366CC;">'prev'</span> <span style="color: #339933;">&amp;&amp;</span> state <span style="color: #339933;">==</span> <span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prevSlide'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setInnerXHTML</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;#&quot; class=&quot;prev&quot;&gt;&amp;lt; previous slide&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>prevSlide<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> <span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span>direction<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	Each<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slideNav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">as</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">as</span>.<span style="color: #660066;">removeClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&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>
&nbsp;
	document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slideNav-&quot;</span><span style="color: #339933;">+</span>currentSlide<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	animating <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> pixelShift <span style="color: #339933;">=</span> slideWidth <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span>currentSlide<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> startingSlideNum <span style="color: #339933;">=</span> currentSlide<span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> Slide_container <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slideWrap'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>direction <span style="color: #339933;">==</span> <span style="color: #3366CC;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		Animation<span style="color: #009900;">&#40;</span>Slide_container<span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">by</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> pixelShift <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">from</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> currentPX <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">by</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'right'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> pixelShift <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">from</span><span style="color: #009900;">&#40;</span>currentPX <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">duration</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ease</span><span style="color: #009900;">&#40;</span>Animation.<span style="color: #660066;">ease</span>.<span style="color: #660066;">both</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">checkpoint</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>startingSlideNum <span style="color: #339933;">==</span> currentSlide<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> animating<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</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: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">go</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>direction <span style="color: #339933;">==</span> <span style="color: #3366CC;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		Animation<span style="color: #009900;">&#40;</span>Slide_container<span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">by</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'right'</span><span style="color: #339933;">,</span> pixelShift <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">from</span><span style="color: #009900;">&#40;</span>currentPX <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">by</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> pixelShift <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">from</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> currentPX <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">duration</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ease</span><span style="color: #009900;">&#40;</span>Animation.<span style="color: #660066;">ease</span>.<span style="color: #660066;">both</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">checkpoint</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>startingSlideNum <span style="color: #339933;">==</span> currentSlide<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> animating<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</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: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">go</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	currentPX <span style="color: #339933;">=</span> pixelShift<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> showSlide<span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	startingSlide <span style="color: #339933;">=</span> currentSlide<span style="color: #339933;">;</span>
	currentSlide <span style="color: #339933;">=</span> num<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>num <span style="color: #339933;">&gt;</span> startingSlide<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>num <span style="color: #339933;">&lt;</span> startingSlide<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">scroll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'right'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>startingSlide <span style="color: #339933;">==</span> maxSlides <span style="color: #339933;">&amp;&amp;</span> currentSlide <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'next'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prev'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentSlide <span style="color: #339933;">==</span> maxSlides <span style="color: #339933;">&amp;&amp;</span> startingSlide <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prev'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'next'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentSlide <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prev'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentSlide <span style="color: #339933;">==</span> maxSlides<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'next'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>startingSlide <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'prev'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>startingSlide <span style="color: #339933;">==</span> maxSlides<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> toggleButton<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'next'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'enable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//--&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>
<h3>FBML Markup</h3>
<p>Simple markup here, slideNav controls the slide with onclicks, the JS does the magic.</p>
<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;div id=&quot;wrapper&quot;&gt;
	&lt;h2&gt;Header&lt;/h2&gt;
	&lt;ul id=&quot;slideNav&quot;&gt;
		&lt;li id=&quot;prevSlide&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;prev disabled&quot;&gt;&amp;lt; previous slide&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot; id=&quot;slideNav-1&quot; onclick=&quot;showSlide(1); return false;&quot; class=&quot;selected&quot;&gt;1&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot; id=&quot;slideNav-2&quot; onclick=&quot;showSlide(2); return false;&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot; id=&quot;slideNav-3&quot; onclick=&quot;showSlide(3); return false;&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot; id=&quot;slideNav-4&quot; onclick=&quot;showSlide(4); return false;&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#&quot; id=&quot;slideNav-5&quot; onclick=&quot;showSlide(5); return false;&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
		&lt;li id=&quot;nextSlide&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;next&quot; onclick=&quot;nextSlide(); return false;&quot;&gt;&amp;gt;&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;div id=&quot;slideWrap&quot;&gt;
        &lt;div id=&quot;slide_1&quot; class=&quot;slide&quot;&gt;
			&lt;h3&gt;&lt;a href=&quot;#&quot;&gt;Title 1&lt;/a&gt;&lt;/h3&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;/div&gt;
&nbsp;
        &lt;div id=&quot;slide_2&quot; class=&quot;slide&quot;&gt;
			&lt;h3&gt;&lt;a href=&quot;#&quot;&gt;Title 2&lt;/a&gt;&lt;/h3&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;/div&gt;
&nbsp;
        &lt;div id=&quot;slide_3&quot; class=&quot;slide&quot;&gt;
			&lt;h3&gt;&lt;a href=&quot;#&quot;&gt;Title 3&lt;/a&gt;&lt;/h3&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;/div&gt;
&nbsp;
        &lt;div id=&quot;slide_4&quot; class=&quot;slide&quot;&gt;
			&lt;h3&gt;&lt;a href=&quot;#&quot;&gt;Title 4&lt;/a&gt;&lt;/h3&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;/div&gt;
&nbsp;
        &lt;div id=&quot;slide_5&quot; class=&quot;slide&quot;&gt;
			&lt;h3&gt;&lt;a href=&quot;#&quot;&gt;Title 5&lt;/a&gt;&lt;/h3&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
			&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/p&gt;
        &lt;/div&gt;
	&lt;/div&gt;
	&lt;!-- end slideWrap --&gt;
&lt;/div&gt;</pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/tutorial/fbjs-slider-carousel/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Getting Started with Facebook JS (FBJS)</title>
		<link>http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs</link>
		<comments>http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs#comments</comments>
		<pubDate>Thu, 25 Feb 2010 05:16:13 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[FBJS]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<guid isPermaLink="false">http://thinkclay.com/?p=1314</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs"><img src="http://thinkclay.com/wp-content/uploads/2010/02/facebook-js-fbjs.jpg" alt="" title="facebook-js-fbjs" width="300" height="200" class="alignleft" /></a>
I’ve only recently started developing Facebook Apps and being a strong front-end developer I was confident that I would be able to pickup FBJS quickly. My confidence what short-lived however, once i discovered that Facebook had a very restricting framework and cache system that would make JS programming something quite a bit less desirable than awesome frameworks like jQuery.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve only recently started developing Facebook Apps and being a strong front-end developer I was very confident that I would be able to pickup FBJS quickly like I have with many other Javascript Frameworks. My confidence what short-lived however, once I discovered that Facebook had a very restricting framework and cache system that would make JS programming something quite a bit less desirable than awesome frameworks like jQuery or Prototype</p>
<h3>What you CAN&#8217;T do in FBJS</h3>
<p>I learned very quickly, that Facebook JavaScript does not allow some very common native functions such as onload, arrays and alerts as well as access to many properties of the document or window level of the DOM. There are workarounds and alternative methods that you can use instead:</p>
<h4>window.onload in FBJS</h4>
<p>Instead of using <em>window.onload</em> to initialize your functions, use <em>setTimeout</em>.</p>
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">setTimeout<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;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>
<p>Even an empty setTimout at the beginning of your script will kick start your functions which would normally auto init (this seems to work fine in canvas, but not so much in tabs).</p>
<h4>alert alternative for FBJS</h4>
<p>Since you can&#8217;t use alert or document.write, use Facebook&#8217;s dialog box:</p>
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Dialog<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">showMessage</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Dialog'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'This is text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>
<h4>document.write alternative for FBJS</h4>
<p>Since you don&#8217;t have access to the document or window levels of the DOM, you&#8217;ll want to setup a little include for testing. I drop in this code when i want to quickly output:</p>
<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script&gt;
function logOutput(){
    var text = &quot;This will be inserted into my log div&quot;;
    document.getElementById('log').setTextValue(text);
}
&lt;/script&gt;
&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;</pre></div></div>
<h4>Trouble with JS Arrays in Facebook</h4>
<p>For whatever reason, facebook also decided to rip out support for creating objects which also eliminated the way most of us make arrays:</p>
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// new Array() is not supported in FBJS</span>
<span style="color: #003366; font-weight: bold;">var</span> myarray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
myarray<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'stuff'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// or</span>
myarray<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'bar'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// or </span>
myarray.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'another example'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>
<p>More to come as I wrestle further with Facebook. Any tips or comments are greatly appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Add, Edit, Delete Cookies with JavaScript</title>
		<link>http://thinkclay.com/technology/add-edit-delete-cookies-with-javascript</link>
		<comments>http://thinkclay.com/technology/add-edit-delete-cookies-with-javascript#comments</comments>
		<pubDate>Mon, 19 Oct 2009 19:30:55 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://thinkclay.com/?p=1187</guid>
		<description><![CDATA[<a href="http://thinkclay.com/wp-content/uploads/2009/10/cookie-in-js.jpg"><img src="http://thinkclay.com/wp-content/uploads/2009/10/cookie-in-js.jpg" alt="cookies in js" title="cookies in js" width="300" height="200" class="alignleft" /></a>There are many ways to communicate and store data from front-end to back-end, but many require AJAX which may take too much time to develop or might not fit the project correctly. A neat alternative to save data and be able to access that data from the server is using <strong>browser cookies</strong>. <a href="http://en.wikipedia.org/wiki/HTTP_cookie">Cookies</a> can be created and destroyed by javascript, and while the syntax can be confusing, I've gathered this little script that will make it easier to use...]]></description>
			<content:encoded><![CDATA[<p>There are many ways to communicate and store data from front-end to back-end, but many require AJAX which may take too much time to develop or might not fit the project correctly. A neat alternative to save data and be able to access that data from the server is using <strong>browser cookies</strong>. <a href="http://en.wikipedia.org/wiki/HTTP_cookie">Cookies</a> can be created and destroyed by javascript, and while the syntax can be confusing, I&#8217;ve gathered this little script that will make it easier to use:</p>
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/* COOKIES OBJECT */</span>
<span style="color: #003366; font-weight: bold;">var</span> Cookies <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// Initialize by splitting the array of Cookies</span>
	init<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: #003366; font-weight: bold;">var</span> allCookies <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'; '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>allCookies.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> cookiePair <span style="color: #339933;">=</span> allCookies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span>cookiePair<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> cookiePair<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #006600; font-style: italic;">// Create Function: Pass name of cookie, value, and days to expire</span>
	create<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">,</span>value<span style="color: #339933;">,</span>days<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>days<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			date.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span>date.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>days<span style="color: #339933;">*</span><span style="color: #CC0000;">24</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">*</span><span style="color: #CC0000;">60</span><span style="color: #339933;">*</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> expires <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;; expires=&quot;</span><span style="color: #339933;">+</span>date.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #003366; font-weight: bold;">var</span> expires <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
		document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;=&quot;</span><span style="color: #339933;">+</span>value<span style="color: #339933;">+</span>expires<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;; path=/&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #006600; font-style: italic;">// Erase cookie by name</span>
	erase<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#91;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
Cookies.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>
<p>Unfortunately, there&#8217;s no easy way to simple update a cookie (correct me if I&#8217;m wrong) but this will allow you to delete and re-create as needed:</p>
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Erase cookie &quot;test&quot;</span>
Cookies.<span style="color: #660066;">erase</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Recreate cookie &quot;test&quot; with a new value of &quot;cookievalue&quot; and set to expire in 10 days</span>
Cookies.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'test'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'cookievalue'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/add-edit-delete-cookies-with-javascript/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pros and Cons of using sIFR</title>
		<link>http://thinkclay.com/technology/pros-cons-using-sifr</link>
		<comments>http://thinkclay.com/technology/pros-cons-using-sifr#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:56:58 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[web browser]]></category>
		<category><![CDATA[web standards]]></category>
		<guid isPermaLink="false">http://thinkclay.com/?p=1068</guid>
		<description><![CDATA[<a href="http://thinkclay.com/technology/pros-cons-using-sifr"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/07/sifr.jpg" alt="sifr" title="sifr" width="300" height="200" /></a>sIFR (scalable Inman Flash Replacement): allows for dynamically-generated snippets of text to use any font supported in Flash using a combination of JavaScript and Flash embedding to replace characters on the page.
In <a href="http://thinkclay.com/technology/cufon-sifr-flir" title="sIFR vs Cufon vs FLIR">my last post regarding sIFR</a>, I compared <strong>sIFR</strong> against <strong>Cufon</strong> and <strong>FLIR</strong>. Since there is a great deal of interest in them, I decided to go deeper into what I believe is the superior out of the three.. ]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/technology/pros-cons-using-sifr"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/07/sifr.jpg" alt="sifr" title="sifr" width="300" height="200" /></a>sIFR (scalable Inman Flash Replacement): allows for dynamically-generated snippets of text to use any font supported in Flash using a combination of JavaScript and Flash embedding to replace characters on the page. </p>
<p>In <a href="http://thinkclay.com/technology/cufon-sifr-flir" title="sIFR vs Cufon vs FLIR">my last post regarding sIFR</a>, I compared <strong>sIFR</strong> against a few of the other popular font replacement methods such as <strong>Cufon</strong> and <strong>FLIR</strong>. Since there is obviously a great deal of interest in the subject of font replacement, I figured it would be beneficial to show a deeper analysis at sIFR which I believe is the superior out of the three.</p>
<h2>A deeper look at pros of sIFR</h2>
<p>sIFR is quite different to the many font replacement techniques in the wild. Instead of manually generating each header through an image generator such as <strong>FLIR</strong> and <strong>Cufon</strong> do, sIFR is able to load a flash object and replace each element on the fly. The scripted effect works for roughly 95% of world wide web users according to statistics for Flash support and JavaScript support in modern browsers. Note also, that sIFR is by no means required, and degrades gracefully if the user does not have one of these components required. I&#8217;m sure some purists would react with contempt, but this method causes no harm to usability and only effects load time if used incorrectly (such as replacing body text rather than headers).</p>
<h2>sIFR&#8230; what&#8217;s not to love?</h2>
<p>First and foremost, implementation can be slaughtered. For an inexperienced developer, sIFR can take up to an hour to implement (from what I&#8217;ve heard in complaints anyways) and can cause pages to load slowly. From my experience, both are due to an incompetent developer, as sIFR is quite easy to implement if you understand all front-end technologies (which you should be a front-end developer) and only causes slow load time if its used for large blocks of text. Compare sIFR to the first wave of Web 2.0 technologies.. to this day I see wannabe developers implementing 20k+ javascript libraries to do one simple &#8220;jiggle&#8221; or &#8220;ajax&#8221; ability, which you can do with a few lines of code if you understand raw JavaScript. We can&#8217;t blame the technology for human error.. sIFR is brilliant. It may have a ways to go before it&#8217;s perfect, but respecting the principles of semantics, usability, and accessibility.. <strong>sIFR</strong> by far is winning the race against <strong>Cufon</strong> and <strong>FLIR</strong>.</p>
<p>Now to address the purists and their complaint about flash and JS dependency. Plain and simply, if a user falls within the 3-10% that doesn’t have Flash or JavaScript enabled, then BIG DEAL. That&#8217;s what good old HTML/CSS are for.. a fall back solution. Should we punish those with modern browsers and technologies for the minority that will get a slightly-less-quality rendering? I don&#8217;t punish modern browsers by neglecting the wonders of CSS 3. If Internet Explorer sees a box with square corners instead of rounded.. BIG DEAL. So why should we fight about whether a user has JS or Flash enabled? Heck, you can even use image replacement at that point, if you really want to. </p>
<h2>The Big Picture</h2>
<p>The real issue is that there aren’t enough fonts supported in Internet Explorer. If we want to point fingers and find something to criticize, there it is. Firefox, Safari, Chrome, Opera.. they&#8217;re all supporting more CSS properties such as <strong>@font-face</strong>. However, due to copyright laws and support from Internet Explorer we are bound to 5-10 fonts that we can reasonably assume the user has installed, and that’s ALL we&#8217;ve got. Solutions have been offered and argued but the problems are still much broader.. ranging from font licensing, support and rendering, with no clear solution in sight.</p>
<p>sIFR is one solution of many offered by developers fighting a war for creative freedom. It&#8217;s here and now, it&#8217;s legal despite the font, and regardless of the few quirks.. it’s usable. If you use it, then I hope you implement it well. If you protest it, then I hope you have valid reasons, and aren&#8217;t just complaining because you&#8217;re ignorant. Take this post with a grain of salt.. it&#8217;s my 2 cents and nothing more.</p>
<h3>Read further:</h3>
<p><a href="http://thinkclay.com/technology/cufon-sifr-flir" title="sIFR vs Cufon vs FLIR">Cufon vs sIFR vs FLIR</a><br />
<a href="http://decasa.eu/content/fonts-seo-and-compatibility-designer%E2%80%99s-dilemma">Style vs SEO</a><br />
<a href="http://www.fontembedding.com/fonts-and-the-law/">Fonts and the Law</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/pros-cons-using-sifr/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Makes You Stand Out</title>
		<link>http://thinkclay.com/technology/what-makes-you-stand-out</link>
		<comments>http://thinkclay.com/technology/what-makes-you-stand-out#comments</comments>
		<pubDate>Tue, 14 Apr 2009 05:44:26 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[goals]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web 2.0]]></category>
		<guid isPermaLink="false">http://thinkclay.com/?p=843</guid>
		<description><![CDATA[<a rel="shadowbox[post-843];player=img;" href="http://thinkclay.com/technology/what-makes-you-stand-out"><img width="300" height="200" class="alignleft" title="What makes YOU stand out" alt="An image of Waldo from Where's Waldo" src="http://thinkclay.com/wp-content/uploads/2009/04/waldo.jpg"/></a>Combining a poor economy with an ever changing web makes it challenging to stay on the cutting edge. With multiple web languages, platforms, and techniques it’s important to dedicate your time to being versatile and flexible while not wasting time learning skills that you won’t use. In the past 2 years I have learned and mastered many tools and techniques, and I’m here to share what has been valuable and where you can trim the fat from your day.]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/wp-content/uploads/2009/04/waldo.jpg"><img class="alignleft" src="http://thinkclay.com/wp-content/uploads/2009/04/waldo.jpg" alt="An image of Waldo from Where&#039;s Waldo" title="What makes YOU stand out" width="300" height="200" class="size-full wp-image-844" /></a>Combining a poor global state of economic growth with an always changing web, makes a challenging formula for staying on the cutting edge and being successful in the web industry. With multiple web languages, platforms, and techniques it&#8217;s important to dedicate your time to being versatile and flexible while not wasting time learning skills that you won&#8217;t use. In the past 2 years I have learned and mastered many tools and techniques, and I&#8217;m here to share what has been valuable and where you can trim the fat from your day.</p>
<h2>Find your strengths and excel above the rest</h2>
<p>So many web developers claim to know all when it comes to web, but when put to the test someone that can write &#8220;hello world&#8221; doesn&#8217;t meet the standards the client expected when they said &#8220;Do you know PHP?&#8221; All developers whether primarily front-end or back-end, should know at least a C level amount in both. To be an awesome back-end developer you need to be able to structure your content in something other than tables or invalid HTML, and to be an awesome back-end developer, you should at least know how to make simple variables and includes to make your job quick and efficient, rather than copying/pasting your doctype and head information on each page. If you want to do well in the next few years, then succeed by being a GURU in at least two of the following: </p>
<ul>
<li><strong>XHTML and CSS</strong> &#8211; with clean and valid markup that works in FF, Webkit, and IE7+</li>
<li><strong>Flex and ActionScript</strong> &#8211; flash/animation/design are a huge plus</li>
<li><strong>JavaScript</strong> &#8211; with and without frameworks, jQuery or MooTools knowledge a plus</li>
<li><strong>PHP</strong> &#8211; cakePHP or codeignitor frameworks will take you to the next level</li>
<li><strong>.NET</strong> &#8211; IIS and server administration a plus</li>
<li><strong>Ruby</strong> &#8211; Rails will take you to the next level</li>
<li><strong>JAVA</strong> &#8211; desktop publishing knowledge a plus</li>
</ul>
<h2>Learn new and trendy technologies</h2>
<p>While following trends isn&#8217;t always a good idea, trends that have been around for more than just a year and have high demand are usually worth taking a second glance at. In the past 5 years, there are a few major trends that are really growing. I highly recommend picking one of the trends and learning as much as you can about the technology on the side of your current studies and work..</p>
<h3>Rich Internet Applications (RIA)</h3>
<p>Adobe Flash has always had a strong presence on the web, and that presence is only increasing along with other RIA platforms like Microsoft Silverlight, JavaFX, and the future HTML5. There are almost no major disadvantages to sites built entirely in Flash or other platforms now that search engines like Google are making more of an effort to index RIA content. To top that, Adobe has now adopted a markup language geared more towards developers called FLEX. Flex allows developers to markup their code in MXML while also using ActionScript for animation and then simply, with the click of a button plublish the application in either a SWF for web or as an AIR application for desktop. I strongly believe this is the future of not only the web, but future Operating Systems as well. Google and Ubuntu have already shown a heavy interest in using web applications on the desktop, and phone operating systems are following a similar pattern. While mobile and desktop development are entirely different from web development, learning FLEX is a great way for web developers to cross that threshold and succeed.</p>
<h3>Agile Development and Object Oriented code</h3>
<p>As the internet reaches the far corners of the Earth, boundaries and barriers are being broken for working remotely on projects. In fact there are many businesses that operate entirely on remote collaboration. This means you need to learn a versioning software and systems (CVS or SVN using Tortoise is a good place to start), how to organize your thoughts and communicate them quickly and effectively over IM or email, and most importantly how to comment and structure your code (for programmers OO principles are a must) so that others can quickly pickup where you left off.</p>
<h3>Web Services and Cross-Platform Markup</h3>
<p>UML, XML, JSON, REST and SOAP, just to name the most common languages, are becoming a must for nearly every developer. Almost every RIA and API use a language like this to communicate. Any site that is dynamic is probably using at least one of these technologies. I can&#8217;t specifically tell you which is more relevant or popular, as it varies per project, but I can tell you that they&#8217;re all fairly simple to learn, so I suggest doing your homework or ready a book on each to know at least base knowledge and markup for each of them.</p>
<h2>Refine your Interpersonal Communication Skills</h2>
<p>As you climb the corporate ladder, or step out into the world of business, it will become more and more important that your written and verbal communication skills are sharp and effective. The gap that used to exist between sales/consulting/design/IT is now closing, and more businesses are switching to an Agile model. This means from the start of a project or team, you may be communicating directly with a client, or with others that don&#8217;t know or understand the technology. You&#8217;ll need to learn how to explain things so that others can easily understand and relate, as well as sound professional and well educated. These skills are not easy to hone, and require a lot of time. I highly recommend actively getting involved in forums/blogging to improve written communication, perhaps join a local business group or Chamber of Commerce to learn how to communicate better in a professional business setting (another perk to this is the networking), and ask others to correct and help you identify bad habits and mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/what-makes-you-stand-out/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Cufon vs sIFR vs FLIR</title>
		<link>http://thinkclay.com/technology/cufon-sifr-flir</link>
		<comments>http://thinkclay.com/technology/cufon-sifr-flir#comments</comments>
		<pubDate>Fri, 10 Apr 2009 03:03:57 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[web browser]]></category>
		<category><![CDATA[web standards]]></category>
		<guid isPermaLink="false">http://thinkclay.com/?p=827</guid>
		<description><![CDATA[<a title="Cufon SIFR FLIR" href="http://thinkclay.com/technology/cufon-sifr-flir"><img width="300" height="200" class="alignleft" title="sifr flir cufon" alt="SIFR FLIR Cufon" src="http://thinkclay.com/wp-content/uploads/2009/04/sifr-flir-cufon.jpg"/></a>In the past few years we’ve seen a growing trend towards forcing new typefaces on the web. CSS defines a property for browsers to support a property called <a href="http://www.w3.org/TR/css3-webfonts/">@font-face</a> which lets the developer define new typefaces and include the original font file for the browser to download and render the site with. Support for this feature has been implemented in Safari and is due to release with the next versions of Firefox and Opera...]]></description>
			<content:encoded><![CDATA[<p><a title="Cufon SIFR FLIR" href="http://thinkclay.com/technology/cufon-sifr-flir"><img class="alignleft" title="sifr flir cufon" src="http://thinkclay.com/wp-content/uploads/2009/04/sifr-flir-cufon.jpg" alt="SIFR FLIR Cufon" width="300" height="200" /></a>Typography is a very important element to design, and it&#8217;s quite a shame that for the past decade we&#8217;ve resorted to using images to display this element, without having the flexibility to define different fonts outside of the 13 or so <a href="http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html">web safe fonts</a>. In the past few years, however, we&#8217;ve seen a growing trend towards forcing new typefaces on the web. CSS defines a property for browsers to support a property called <a href="http://www.w3.org/TR/css3-webfonts/">@font-face</a> which lets the developer define new typefaces and include the original font file for the browser to download and render the site with. Support for this feature has been implemented in Safari already and is due to release with the next versions of Firefox and Opera. Though this is definitely good news and progress in the right direction, a few issues stand in the way:</p>
<ul>
<li>Copyright is an issue for downloading and sharing fonts via the font-face attribute</li>
<li>Internet Explorer 6-8 do not support font-face</li>
<li>Font-face could potentially pose a threat if malicious sites attach/spread viruses via the font files</li>
</ul>
<p>Until <strong>font-face</strong> is fully adopted, web developers must resort to complimentary or supplementary solutions to make non-traditional typefaces work. There are few major flash and javascript solutions in existence that offer solutions with different approaches to displaying these typefaces. The three major typeface scripts that I am going to discuss are <a href="http://www.mikeindustries.com/blog/sifr/">SIFR</a>, <a href="http://facelift.mawhorter.net/examples/">FLIR</a>, and <a href="http://cufon.shoqolate.com/generate/">Cufón</a>. Before diving into details about each I&#8217;d like to point out that all of these solutions that I discuss are 100% SEO friendly, and all require JavaScript (and flash in the case of SIFR) but degrade to standard markup if JS is not enabled, also note that each of these play well with jQuery.</p>
<h2>SIFR (Scalable Inman Flash Replacement)</h2>
<p>First I must address the acronym, thought not the most relevant seeming, &#8220;Inman&#8221; is referring to <a href="http://www.shauninman.com/">Shaun Inman</a> who originally conceived the idea of using the DOM and Flash together to support non-traditional typefaces. SIFR uses a flash object to render to the font face, and then Javascript to identify the DOM and replace the text as specified.</p>
<h3>Pros of SIFR</h3>
<ul>
<li>Text can be selected</li>
<li>Does not violate EULA or copyrights, since font is contained within the SWF object</li>
<li>You can easily add shadows, anti-aliasing, and other text effects in Flash</li>
</ul>
<h3>Cons of SIFR</h3>
<ul>
<li>Slightly slower load times</li>
<li>Requires both JavaScript and Flash to be enabled</li>
</ul>
<h3>My thoughts on SIFR</h3>
<p>Some people complain that SIFR is harder to implement, but if you&#8217;re a front-end web developer it&#8217;s vital to learn and master new technologies including really basic flash. All you have to do is open the flash file included in the zip, change the font of the text to the font you want to use, and then publish it. Instructions are included on how to do this and if it is &#8220;too challenging&#8221; than you&#8217;re in the wrong field!</p>
<p>Many have also commented and argued that SIFR is no more secure to stealing a font file and using it on your website. While I do agree with that statement, the issue is a legal matter. Like it or not, and argue it as you may, Adobe Flash is legally allowed to embed and use fonts that the developer has purchased. This is not true for any of the others.</p>
<h2>FLIR (Face Lift Image Replacement)</h2>
<p>Using PHP (and the GD library) FLIR renders text into a font of your choice by reading the text in a DOM and sending a request to the server with that string and returning an image of that text rendered in the new font. It&#8217;s a very clever idea, and works behind the scenes, but it&#8217;s not without it&#8217;s quirks.</p>
<h3>Pros of FLIR</h3>
<ul>
<li>Does not violate EULA or copyrights, since font is rendered as an image</li>
<li>Prints in the font rendered since it is an image</li>
</ul>
<h3>Cons of FLIR</h3>
<ul>
<li>Requires PHP with the GD enabled</li>
<li>Text cannot be selected</li>
</ul>
<h3>My thoughts on FLIR</h3>
<p>While FLIR is fast and efficient with few flaws, one restriction I cannot overlook is the requirement for PHP and GD on the server. Many corporate websites (addressing the big guys, not the freelancers with this one) work exclusively with .NET on Windows/IIS servers without PHP installed at all. This eliminates FLIR from the mix for many websites unfortunately. In addition, FLIR disables the user to be able to select text. This is not a huge draw back if used on headings, but if used on a even body of text then you&#8217;re killing usability.</p>
<h2>Cufon</h2>
<p>Cufon is basically a new and improved version of <a href="http://typeface.neocracy.org/">Typeface.js</a>, with a focus on faster and easier implementation. Cufon uses the browser to draw vector objects using VML (Vector Markup Language) for Internet Explorer and the HTML 5 Canvas element for the more advanced browsers.</p>
<h3>Pros of Cufon</h3>
<ul>
<li>Faster load times than SIFR and FLIR, since it is all JS and nothing more</li>
<li>Has all the strengths of Typeface.js with fewer weaknesses.</li>
</ul>
<h3>Cons of Cufon</h3>
<ul>
<li>Violates EULA and copyrights due to fonts being embedded. Not many fonts are permitted to be rendered with this method</li>
<li>Text cannot be selected</li>
<li>You can&#8217;t apply a hover state to converted text</li>
</ul>
<h3>My thoughts on Cufon</h3>
<p>For many, Cufon is the best solution to work with. It allows for rendering on the fly, and works well for a developer to match a design without having to replace each heading with an image. Cufon even works quickly with large bodies of text! One thing I remain disappointed about is text selection; if this library aims to provide a solution for larger bodies of text, then it seems that text selection is a must.</p>
<p>As I have tested and worked with Cufon, I recommend it for the developer looking for a quick solution but only for personal or non-profit website. I&#8217;ve talked with a few professionals including a lawyer and confirmed that Cufon is not a legal solution for font-embedding on ANY website, but that unless you&#8217;re developing a large profile commercial site, you should be safe to use it freely.</p>
<p>If you&#8217;d like to learn more about Cufon, check out the <a href="http://net.tutsplus.com/videos/screencasts/the-easiest-way-to-use-any-font-you-wish/" rel="external">tutorial on TutsPlus</a>.</p>
<h3>Read further:</h3>
<p><a href="http://thinkclay.com/technology/cufon-sifr-flir" title="sIFR vs Cufon vs FLIR">Cufon vs sIFR vs FLIR</a><br />
<a href="http://decasa.eu/content/fonts-seo-and-compatibility-designer%E2%80%99s-dilemma">Style vs SEO</a><br />
<a href="http://www.fontembedding.com/fonts-and-the-law/">Fonts and the Law</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/cufon-sifr-flir/feed</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>JavaScript Libraries</title>
		<link>http://thinkclay.com/technology/javascript-libraries</link>
		<comments>http://thinkclay.com/technology/javascript-libraries#comments</comments>
		<pubDate>Tue, 02 Dec 2008 05:51:55 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[developer tools]]></category>
		<category><![CDATA[front-end]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<guid isPermaLink="false">http://www.new-age-design.com/?p=354</guid>
		<description><![CDATA[There is so much to be said about Javascript Libraries (JavaScript Toolkits or JavaScript Frameworks, if you prefer those terms, they&#8217;re all pretty much the same thing in regards to what I&#8217;m writing about). What is a JavaScript Library JavaScript Libraries were born as demands for JavaScript rose to create more interactive and dynamic websites. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://thinkclay.com/wp-content/uploads/2008/12/jquery_logo_color_onwhite.png"><img src="http://thinkclay.com/wp-content/uploads/2008/12/jquery_logo_color_onwhite-490x120.png" alt="jquery_logo_color_onwhite" title="jquery_logo_color_onwhite" width="490" height="120" class="alignnone size-large wp-image-1107" /></a><br />
There is so much to be said about Javascript Libraries (JavaScript Toolkits or JavaScript Frameworks, if you prefer those terms, they&#8217;re all pretty much the same thing in regards to what I&#8217;m writing about).</p>
<h3>What is a JavaScript Library</h3>
<p>JavaScript Libraries were born as demands for JavaScript rose to create more interactive and dynamic websites. Some developers wanted more movement and animation in their applications to enhance the user experience, and others wanted a library focused around quicker and easier XMLHttpRequests (coined AJAX) to make their applications faster and more responsive.</p>
<blockquote><p>A <strong>JavaScript Library</strong> is a library of pre-written JavaScript code, such as functions and classes, which allow for more efficient development of JavaScript-based applications.</p></blockquote>
<p>Some of the first libraries to emerge to meet these needs were <a title="Go to the Prototype Library Website" href="http://www.prototypejs.org/"><strong>Prototype</strong></a>, developed by Sam Stephenson, and <a title="Scriptaculous JavaScript Framework Website" href="http://script.aculo.us"><strong>Scriptaculous</strong></a> by <a title="Go to Thomas Fuchs' Website" href="http://mir.aculo.us/">Thomas Fuchs</a>. In later years, JavaScript libraries such as <a title="JQuery Library Website" href="http://jquery.com"><strong>jQuery</strong></a>, <a title="Mootools Library Website" href="http://mootools.net"><strong>MooTools</strong></a>, and <a title="Mochikit Framework Website" href="http://mochikit.com"><strong>MochiKit</strong></a> and JavaScript widget libraries such as <a title="Ext Javascript Library" href="http://extjs.com"><strong>Ext JS</strong></a> and <a title="Dojo Toolkit Website" href="http://http://dojotoolkit.org"><strong>Dojo Toolkit</strong></a> have emerged, each meeting a specific developer need and specializing in meeting that need in a unique way.</p>
<p>Following this trend, major companies have developed their own libraries to meet their specific needs. Some of the more popular ones are the <a title="Google Web Toolkit Website" href="http://code.google.com/webtoolkit/">Google Web Toolkit (GWT)</a>, <a title="Yahoo User Interface Framework Website" href="http://developer.yahoo.com/yui/">Yahoo User Interface Library (YUI)</a>, and <a title="Microsoft ASP.NET AJAX Framework Website" href="http://www.asp.net/ajax/">ASP.NET AJAX</a>.</p>
<h3>What are JavaScript Libraries for</h3>
<p>JavaScript Libraries allow for easier development between JavaScript and other languages, such as CSS, PHP, Python and Java. This allows not only for a developer to read and write code in a style that they are more familiar with, but it also helps in developing seamless applications across different languages and environments.</p>
<h3>JavaScript Libraries in Front-End Web Development</h3>
<p>While there may be arguments for different libraries and different advantages and disadvantages of each, I&#8217;m am going to focus on these libraries from MY perspective which is in Front-end development across many platforms, applications and programs, and my views are bias to my experience in those settings. If you have an opinion or contribution of your own feel free to add them in the comments in a constructive and informative manner please!</p>
<h4>jQuery</h4>
<p>My absolute favorite library is jQuery. JQuery is a very lightweight and modular JavaScript Framework that weighs in at only 15k for the compressed core. Some of the great features of jquery for front-end web developers are its ease of use and learning. The library targets the Document Object Model (DOM) in the same way that CSS does, using selectors such as ID&#8217;s and classes as well as the standard nodes (element, text, and attribute). I also like that the framework is modular, which means you can get down and dirty with the core with little bandwidth eaten up, but extend it as far as needed with plug-ins.</p>
<h4>YUI</h4>
<p>YUI is another really lightweight library that separates its modules so that you can simply use the utilities needed without bloated code. While there are probably better candidates for this second slot as far as extensibility and compression (many would probably argue that MooTools belongs here), what I particularly like about Yahoo&#8217;s library is their documentation for it. When you get deep into code and complex structures, you test the limits of your framework. When your code breaks the framework (and it WILL at some point), it&#8217;s good to be able to reference well documented and explained code that way you can identify the problem and work towards a solution. That&#8217;s my reason for replacing MooTools with YUI in my faves.</p>
<h4>Prototype &amp; Scriptaculous</h4>
<p>I used to love these frameworks, but as jQuery has grown and become more efficient, I&#8217;ve moved away from the bloated code that was once a part of my utility belt. I would like to hear anyone&#8217;s feedback that still primarily uses these libraries and see if there are any advantages that these veterans have over the new ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/javascript-libraries/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automate to save time and money!</title>
		<link>http://thinkclay.com/technology/automate-to-save-time-and-money</link>
		<comments>http://thinkclay.com/technology/automate-to-save-time-and-money#comments</comments>
		<pubDate>Wed, 13 Aug 2008 19:41:56 +0000</pubDate>
		<dc:creator>Clay McIlrath</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[freelance]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web 2.0]]></category>
		<guid isPermaLink="false">http://www.new-age-design.com/?p=14</guid>
		<description><![CDATA[The guys over at Chosen Creative have given us yet another awesome way to make are lives easier! This script generates a list of all files in a directory using a PHP function to read the directory files starting with the underscore _ character, and then it outputs them into a JQuery styled accordion menu! [...]]]></description>
			<content:encoded><![CDATA[<p>The guys over at <a title="Chosen Creative Advertising" href="http://chosencreative.com">Chosen Creative</a> have given us yet another awesome way to make are lives easier! This script generates a list of all files in a directory using a PHP function to read the directory files starting with the underscore _ character, and then it outputs them into a JQuery styled accordion menu!</p>
<p><strong>Here&#8217;s the JQ </strong></p>
<div class="wp_syntax"><div 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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li.child:visible&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li.parent&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</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;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;selected&quot;</span><span style="color: #009900;">&#41;</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;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</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: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'selected'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</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;">children</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;medium&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<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></div></div>
<p><strong>Here&#8217;s the PHP</strong></p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">opendir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">readdir</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/^\_/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\_/'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;
	&lt;li class=&quot;</span>\<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>parent\<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #0000ff;">&quot;&gt;&lt;a href=&quot;</span>\<span style="color: #0000ff;">&quot;&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&lt;/li&gt;
<span style="color: #000099; font-weight: bold;">\n</span>
	&lt;li class=&quot;</span>\<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>child\<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #0000ff;">&quot;&gt;&lt;/li&gt;
&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #990000;">closedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://thinkclay.com/technology/automate-to-save-time-and-money/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
