<?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>Out to Lunch Productions &#187; jQuery</title>
	<atom:link href="http://www.outtolunchproductions.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.outtolunchproductions.com</link>
	<description>Silly name. Serious websites.</description>
	<lastBuildDate>Mon, 02 Jan 2012 19:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Strategic Productions, LLC</title>
		<link>http://www.outtolunchproductions.com/strategicproductions/</link>
		<comments>http://www.outtolunchproductions.com/strategicproductions/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 15:47:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.outtolunchproductions.com/?p=755</guid>
		<description><![CDATA[<p><strong>Creative Brief:</strong> Design and build a portfolio website for a video production and online distribution strategy company.</p>
<p>Getting the production site up and running took a little longer than I predicted due to a late-in-the-game design decision, but I&#8217;m much&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Creative Brief:</strong> Design and build a portfolio website for a video production and online distribution strategy company.</p>
<p>Getting the production site up and running took a little longer than I predicted due to a late-in-the-game design decision, but I&#8217;m much happier with where it wound up than I would have been.</p>
<p>The center-piece of the site, the portfolio slider on the front page, uses the Page Thumbnail functionality of WordPress 2.9 to make it ridiculously easy to add new items. This is unlike the slider on my front page, which is hand-crafted in Coda because I don&#8217;t want the XHTML section of my brain to atrophy.</p>
<p>Since there is a secondary slider on the portfolio pages, I set the thumbnail sizes in WordPress to generate the appropriate sizes so that each image only had to be uploaded one time in one place to put the correct images in both places.</p>
<h2>The Road Not Taken</h2>
<p>The first iterations of the design were very dark, <em>brooding</em> almost. Paul Lucci, my partner in crime over at Crooked Gremlins, was brought on to do the illustration work and to help with the logo. The first ideas we had matched the attitude of the site, which was way too serious.</p>
<div id="attachment_757" class="wp-caption aligncenter" style="width: 680px"><img src="http://www.outtolunchproductions.com/wp-content/uploads/2010/04/The-Goddess.png" alt="" title="The-Goddess" width="670" height="338" class="size-full wp-image-757" /><p class="wp-caption-text">The Metal Goddess, indicating strength</p></div>
<div id="attachment_758" class="wp-caption aligncenter" style="width: 680px"><img src="http://www.outtolunchproductions.com/wp-content/uploads/2010/04/The-Strategy.png" alt="" title="The-Strategy" width="670" height="338" class="size-full wp-image-758" /><p class="wp-caption-text">The game-board, indicating strategy</p></div>
<p>Ultimately, the client wanted a more light-hearted look, which we pulled off with a lighter color palette and brighter imagery in the slider.</p>
<p><img src="http://www.outtolunchproductions.com/wp-content/uploads/2010/04/support.png" alt="" title="support" width="200" height="246" class="alignright size-full wp-image-759" style="border:0;" /><br />
<h2>The Services Section</h2>
<p>One of the last pieces of the site to come together was the Services section. I&#8217;m still kind of amazed how it only takes one or two ideas to make a thing that seemed totally broken and unapproachable a nice thing to look at.</p>
<p>Paul provided the illustrations here, as well.</p>
<p><a href="http://www.strategicproductionsllc.com">Visit the site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.outtolunchproductions.com/strategicproductions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Countup: The ASRL Gift of Time Counter</title>
		<link>http://www.outtolunchproductions.com/countup/</link>
		<comments>http://www.outtolunchproductions.com/countup/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 02:29:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.outtolunchproductions.com/?p=699</guid>
		<description><![CDATA[<p>The most noteworthy of my clientelle is the <a href="http://www.andreriveroflife.org">Andre Sobel River of Life Foundation</a>. They&#8217;ve been a steady source of work for the last year, and every day in which I do something to improve their web presence is,&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>The most noteworthy of my clientelle is the <a href="http://www.andreriveroflife.org">Andre Sobel River of Life Foundation</a>. They&#8217;ve been a steady source of work for the last year, and every day in which I do something to improve their web presence is, to me, a day well spent.</p>
<p>When I was asked how difficult it would be to create a live counter on the site that showed the number of minutes that the organization has given to the families it has helped, my first thought was something along the lines of &#8220;not very difficult at all.&#8221;</p>
<p>I mean, really. How hard could it possibly be? I knew of some simple Javascript codelets that could immediately provide a solution for a ticking clock. But, once I wrote out the actual feature list for the thing I was creating, I noticed some pretty big hurdles.</p>
<p>Here&#8217;s what the counter needed to produce:</p>
<ul>
<li>The number of minutes that have passed since January 1st of 2000, along with a ticking seconds counter.</li>
<li>This number must be live, updating on the page constantly.</li>
<li>Each individual number must be wrapped in its own container, with pictures of specific children behind them.</li>
<li>Clicking on a number/child will bring up that child&#8217;s story.</li>
<li>Supply an embeddable widget that other people can put on their blogs/MySpace/Facebook pages.</li>
</ul>
<h3>Getting the number of minutes</h3>
<p>This was the easiest part of this entire equation: display the number of minutes that have elapsed between now and January 1st, 2000. Since the number of minutes needed to be the same regardless of timezone (this was actually a big deal), I couldn&#8217;t use Javascript. So, I wrote this extremely simple PHP script:</p>
<p><code><?php<br />
date_default_timezone_set('America/Los_Angeles');</p>
<p>$time = strtotime('January 2000');<br />
$now = time();<br />
$diff = $now - $time;</p>
<p>echo $diff;<br />
</code></p>
<p>The time() command will always return time in Unix Epoch format, which is the number of seconds that have elapsed since January 1, 1970. The number of seconds between January of 2000 and now is simply the difference between the two variables (on line 6).</p>
<p>Everytime this script loads, it prints a number that looks something like this: <strong>321178160</strong>. Originally, I had the script divide by 60 (giving me the number of minutes) and kick that out, but I realized that since I needed the seconds to tick on the page, it would have to load this server-side script every second. This would not have been ideal (actually, this is how the embeddable widget works, but it's only running the script once; it doesn't implement ticking seconds or keep the clock live).</p>
<h3>Minutes, not seconds</h3>
<p>For performance's sake, I had to keep as much stuff as possible on the client side. The minutes are calculated from the PHP clock script, and then Javascript adds time to it. The seconds are done entirely with Javascript, since the timezone for the seconds is irrelevant.</p>
<h3>Parsing the Number</h3>
<p>First thing I needed was an AJAX call to grab the number from the clock.php script. That much was easy:<br />
<code>$.ajax({<br />
  url: '/clock/counter.php',<br />
  success: function(data) {</p>
<p>    c=parseInt(data);<br />
    maketime();</p>
<p>  }<br />
});</code></p>
<p>Then, I needed to turn that number into minutes and wrap each digit in its own container. But, this number also had to be updated every second, which was accomplished by adding 1 to the number from the PHP script every second and then dividing by 60. Like so:</p>
<p><code>function maketime(){</p>
<p>var t;<br />
c=c+1;<br />
epic = c;<br />
t=setTimeout("maketime(); wrapem()",1000);<br />
epic = addCommas(Math.round(epic / 60));<br />
var timeoffset = (+29800);<br />
var now = new Date();<br />
now.setTime(now.getTime() + timeoffset);<br />
var seconds = now.getSeconds();<br />
var s = ((seconds < 10) ? ":0" : ":") + seconds;<br />
nowtime = epic + s;</p>
<p>arr = nowtime.split("");</p>
<p>clock = arr.join("</span><span class='number'>");<br />
clock = "<span class='number'>"+clock+"</span>";</p>
<p>$(function(){<br />
	$("#asrl-clock").html(clock);<br />
	$(".number:nth-child(2), .number:nth-child(6)").addClass('comma').removeClass('number');<br />
    $(".number:nth-child(10)").addClass('colon').removeClass('number');<br />
    $(".number:last").addClass("last");<br />
    wrapem();<br />
	});</p>
<p>}</code></p>
<p>The wrapem() function is actually a little bit misleading in its name. Really, the wraps are applied to each character when they are split into an array and rejoined in their own spans. What wrapem() does is attach appropriate numbers to their corresponding background image and link.</p>
<p><code>function wrapem(){<br />
	$(".number:nth-child(1)").attr("id","one");<br />
	$(".number:nth-child(3)").attr("id","three").wrap('&lt;a href="/2010/02/27/meet-alia" class="clink" /&gt;');<br />
	$(".number:nth-child(4)").attr("id","four").wrap('&lt;a href="/2010/02/27/meet-anthony-2" class="clink" /&gt;');<br />
	$(".number:nth-child(5)").attr("id","five").wrap('&lt;a href="/2010/02/27/meet-daniela" class="clink" /&gt;');<br />
	$(".number:nth-child(7)").attr("id","seven").wrap('&lt;a href="/2010/03/04/meet-noah/" class="clink" /&gt;');<br />
	$(".number:nth-child(8)").attr("id","eight").wrap('&lt;a href="2010/03/04/meet-robbie/" class="clink" /&gt;');<br />
	$(".number:nth-child(9)").attr("id","nine").wrap('&lt;a href="/2010/03/04/meet-augustin/" class="clink" /&gt;');<br />
	$(".number:nth-child(11)").attr("id","eleven");<br />
	$(".number:nth-child(12)").attr("id","twelve");</p>
<p>	$("#one").css({background:"url(/clock/images/alex.jpg) no-repeat center center"}).wrap('&lt;a href="/2010/02/27/meet-alex-2" class="clink" /&gt;');<br />
	$("#three").css({background:"url(/clock/images/alia.jpg) no-repeat center center"});<br />
	$("#four").css({background:"url(/clock/images/anthony.jpg) no-repeat center center"});<br />
	$("#five").css({background:"url(/clock/images/daniela.jpg) no-repeat center center"});<br />
	$("#seven").css({background:"url(/clock/images/noah.jpg) no-repeat center center"});<br />
	$("#eight").css({background:"url(/clock/images/robbie.jpg) no-repeat center center"});<br />
	$("#nine").css({background:"url(/clock/images/augustin.jpg) no-repeat center center"});<br />
}<br />
</code></p>
<h3>The Live Link Problem</h3>
<p>Originally, I was going to use the Thickbox functionality that I had already loaded for a different section of the page to open the story boxes for the kids. Unfortunately, it didn't work, and it took me a while to figure out why. Essentially, the links weren't part of the DOM when the page loaded; they were created after the clock script had time to run and generate the numbers. In fact, as far as the DOM was concerned, these numbers were completely new every time the maketime() function ran; every single second. After banging my head against the desk for about three hours, I realized that it would be easy to write my own simple lightbox script and use jQuery's live() method to activate them.</p>
<p><code>$(function(){<br />
	$(".clink").live('click', function(){<br />
		hrefval = $(this).attr('href');<br />
		$.ajax({ url: hrefval, context: $(".entry"), success: function(data){<br />
		$("#story").fadeOut('fast');<br />
		$("#story").html(data).fadeIn('fast');<br />
      }});<br />
		return false;<br />
	});<br />
	$(".close-story").live('click', function(){<br />
		$("#story").fadeOut('fast');<br />
		return false;<br />
	});<br />
});</code></p>
<p>By using the href attribute, I didn't even have to change the links that the AJAX was grabbing the data from.</p>
<h3>Styling the Counter</h3>
<p>Using the split() and join() Javascript functions let me wrap each character in a span, but the problem is that I had two commas and a colon (great name for a TV show, BTW) that, in fact, couldn't be set in their own curved box. Luckily, this number will be seven digits long for the next 10 years and change, so I was able to use the nth selector to remove the "number" class from the characters.</p>
<p>I set the background images for the digits using the same method. I'm sure there's a more elegant way to solve this problem, but I had to weigh how much time I had left to spend on it vs. how much the end user would benefit from some slightly improved code.</p>
<h3>Final Thoughts</h3>
<p>I wound up learning a lot about JSON and XSS (cross-server scripting) which wound up being irrelevant to the big counter on the home page, but vital to the embeddable one.</p>
<p>Also, I found out that you can embed stylesheets in Javascripts. Like so:</p>
<p><code>function loadJSON(url) {<br />
  var headID = document.getElementsByTagName("head")[0];<br />
  var newScript = document.createElement('script');<br />
      newScript.type = 'text/javascript';<br />
      newScript.src = url;<br />
  headID.appendChild(newScript);</p>
<p>  stylesheet = document.createElement("link");<br />
    stylesheet.rel = "stylesheet";<br />
    stylesheet.type = "text/css";<br />
    stylesheet.href = "http://andreriveroflife.org/clock/clockstyle.css";<br />
    stylesheet.media = "all";<br />
    document.lastChild.firstChild.appendChild(stylesheet);</p>
<p>}</p>
<p>function processJSON(feed){<br />
     document.writeln(feed.returned);<br />
}</p>
<p>loadJSON('http://andreriveroflife.org/clock/counter.php?json=?');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.outtolunchproductions.com/countup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WVAU.org</title>
		<link>http://www.outtolunchproductions.com/wvau-org/</link>
		<comments>http://www.outtolunchproductions.com/wvau-org/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:44:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.outtolunchproductions.com/?p=695</guid>
		<description><![CDATA[<p><strong>Creative Brief:</strong> Convert a Photoshop layout done by Ross Nover into a WordPress theme. Oh, and just a little &#8220;thing&#8221; that will display what show is currently on the air at our college radio station.</p>
<p>Obviously, the first part is&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Creative Brief:</strong> Convert a Photoshop layout done by Ross Nover into a WordPress theme. Oh, and just a little &#8220;thing&#8221; that will display what show is currently on the air at our college radio station.</p>
<p>Obviously, the first part is easy and straightforward. For the second part, I wanted to provide them with something that would let them easily maintain a schedule of rotating shows without having to muck about in an XML file or something.</p>
<p>I wound up developing an increasingly robust plugin that I named <a href="/showtime">Showtime</a>. It has a pretty narrow set of real-world applications, but I still think it&#8217;s super-useful when applied correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.outtolunchproductions.com/wvau-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Andre Sobel River of Life</title>
		<link>http://www.outtolunchproductions.com/andreriveroflife/</link>
		<comments>http://www.outtolunchproductions.com/andreriveroflife/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 06:43:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.outtolunchproductions.com/?p=368</guid>
		<description><![CDATA[<p><strong>Creative Brief:</strong> Provide a fresh and innovative look for an established charitable organization to help drive online donations and participations.</p>
<p>It was necessary to create a visual aesthetic that synced up with their current organizational philosophy and structure.</p>
<p><strong>The &#8220;wow&#8221;</strong>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Creative Brief:</strong> Provide a fresh and innovative look for an established charitable organization to help drive online donations and participations.</p>
<p>It was necessary to create a visual aesthetic that synced up with their current organizational philosophy and structure.</p>
<p><strong>The &#8220;wow&#8221; factor</strong>: A new kind of slider. A great deal of my professional life is consumed by people&#8217;s love of jQuery, which is awkward since I can&#8217;t lay any claim to the scripting itself. I simply put it in front of people and let them say &#8220;Whoa.&#8221;</p>
<p>This slider differs from the <a href="http://www.realpolitech.com/people">RealPolitech</a> slider in that it uses text links at the bottom of the imagery for navigation, as opposed to vertical slats that eat up a bunch of space.</p>
<p><a href="http://andreriveroflife.org">Visit the Andre Sobel site.</a></p>
<h2>Deceptively simple</h2>
<p>This site contains a great deal of content. which may not be apparent to the average user. This is the designer/developer&#8217;s job; <em>make it look easy</em>. If a user feels encumbered or inconvenienced by your website, they will not come back.</p>
<p>Any student of web design, when confronted in a moment of honesty, will tell you that they continually search for ways to make sites simpler. The two words that we hear the most in our line of business? <strong>Clean + Simple.</strong></p>
<p>By way of comparison, here is a screen shot of their previous design.</p>
<p><img class="size-medium wp-image-389" title="safariscreensnapz002" src="http://www.outtolunchproductions.com/wp-content/uploads/2009/06/safariscreensnapz002-300x264.jpg" alt="safariscreensnapz002" width="300" height="264" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.outtolunchproductions.com/andreriveroflife/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RealPolitech</title>
		<link>http://www.outtolunchproductions.com/realpolitech/</link>
		<comments>http://www.outtolunchproductions.com/realpolitech/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 17:51:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.outtolunchproductions.com/?p=350</guid>
		<description><![CDATA[<p><strong>Creative Brief: </strong>Design and code a showcase/client-nabbing website for a consortium of social entrepreneurs. We started with the iconic image of a guy in a crowd holding up a Flip-Cam and went from there.</p>
<p>The sites needs to show off not only&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Creative Brief: </strong>Design and code a showcase/client-nabbing website for a consortium of social entrepreneurs. We started with the iconic image of a guy in a crowd holding up a Flip-Cam and went from there.</p>
<p>The sites needs to show off not only the work that the consortium does/can do, but also the people within the organization.</p>
<p><strong>&#8220;Wow&#8221; Factor:</strong> The <a href="http://www.realpolitech.com/people">slider</a> on the People page. Uses jQuery and draws from dynamic posts (as opposed to being hard-coded into the template.)</p>
<p><a href="http://www.realpolitech.com">Visit RealPolitech.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.outtolunchproductions.com/realpolitech/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

