<?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>Eli Kirk</title>
	<atom:link href="http://elikirk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://elikirk.com</link>
	<description></description>
	<lastBuildDate>Mon, 17 Jun 2013 23:08:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Project Manager</title>
		<link>http://elikirk.com/2013/06/14/project-manager/</link>
		<comments>http://elikirk.com/2013/06/14/project-manager/#comments</comments>
		<pubDate>Fri, 14 Jun 2013 15:12:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1921</guid>
		<description><![CDATA[<p>Summary Seeking a project manager to oversee project management in a creative agency and Web development environment. Description The project manager will report to the company president and will oversee the successful completion of client projects, speciﬁcally working to ensure that all work exceeds client expectations and is completed on time and on budget. He [...]</p><p>The post <a href="http://elikirk.com/2013/06/14/project-manager/">Project Manager</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<h3>Summary</h3>
<p>Seeking a project manager to oversee project management in a creative agency and Web development environment.</p>
<h3>Description</h3>
<p>The project manager will report to the company president and will oversee the successful completion of client projects, speciﬁcally working to ensure that all work exceeds client expectations and is completed on time and on budget. He or she will:</p>
<ol>
<li>Manage projects for a portfolio of clients;</li>
<li>Track budgets, timelines and proﬁtability;</li>
<li>Coordinate work across our strategy, design and programming teams;</li>
<li>Handle day-to-day communications with his or her assigned clients.</li>
</ol>
<h3>Qualifications</h3>
<p>The ideal candidate will have:</p>
<ol>
<li>At least 2 years of dedicated project management experience;</li>
<li>Demonstrated success in managing people and client relationships; and</li>
<li>Demonstrated aptitude for managing timelines and budgets.</li>
</ol>
<h3>Compensation</h3>
<p>Compensation will be negotiated commensurate with experience. Health insurance will be available following one full calendar month of employment. No relocation package is offered with this position.</p>
<h3>Application</h3>
<p>Submit a resume and cover letter to Bill Brady at bill@elikirk.com. Employment and character references should also be included.</p>
<p>Please direct all inquiries about the position to Bill Brady at 801-377-9321 x207.</p>
<p>The post <a href="http://elikirk.com/2013/06/14/project-manager/">Project Manager</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2013/06/14/project-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flexbox CSS Cross-browser Issues</title>
		<link>http://elikirk.com/2013/06/05/flexbox-css-cross-browser-issues/</link>
		<comments>http://elikirk.com/2013/06/05/flexbox-css-cross-browser-issues/#comments</comments>
		<pubDate>Wed, 05 Jun 2013 19:09:45 +0000</pubDate>
		<dc:creator>Chris Rock</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Flexbox]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1864</guid>
		<description><![CDATA[<p>In my Flexbox CSS Tutorial post, I talked about all the great and interesting features that flexbox offers. Unfortunately, the implementation of these features is currently a mess. The reason comes from the fact that the specifications have changed and matured over time, and different browsers have implements that changing spec at different times. We [...]</p><p>The post <a href="http://elikirk.com/2013/06/05/flexbox-css-cross-browser-issues/">Flexbox CSS Cross-browser Issues</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>In my <a href="http://elikirk.com/2013/06/05/flexbox-css-tutorial/">Flexbox CSS Tutorial</a> post, I talked about all the great and interesting features that flexbox offers. Unfortunately, the implementation of these features is currently a mess. The reason comes from the fact that the specifications have changed and matured over time, and different browsers have implements that changing spec at different times. We ended up with three distinct implementations of the flexbox spec, an early attempt at it (legacy), a hybrid of the older and newer specs (hybrid) and the latest implementation (modern).</p>
<h3>Legacy Flexbox</h3>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> box<span style="color: #00AA00;">;</span>
    box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* vertical */</span>
    box-direction<span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* reverse */</span>
    box-align<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* start, end, stretch */</span>
    box-pack<span style="color: #00AA00;">:</span> start<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* end, center, justify */</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    box-flex<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* 0 */</span>
    box-ordinal-group<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>There are a few things to notice about this. First, the equivalent to the modern flexbox&#8217;s <code>flex-direction</code> is split into two different declarations&#8211;<code>box-orient</code> and <code>box-direction</code>. The modern&#8217;s <code>justify-content</code> is instead <code>box-align</code> and <code>align-items</code> is <code>box-pack</code>. Also, there&#8217;s no <code>flex-grow</code> or <code>flex-shrink</code>, just <code>box-flex</code>, and <code>order</code> is <code>box-ordinal-group</code>.</p>
<h3>Hybrid Flexbox</h3>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -ms-flexbox<span style="color: #00AA00;">;</span>
    -ms-flex-direction<span style="color: #00AA00;">:</span> row<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* column, row-reverse, etc. */</span>
    -ms-flex-wrap<span style="color: #00AA00;">:</span> wrap <span style="color: #808080; font-style: italic;">/* nowrap */</span>
    -ms-flex-align<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* start, end, stretch */</span>
    -ms-flex-pack<span style="color: #00AA00;">:</span> start<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* end, center, justify */</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    -ms-flex<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* 0 */</span>
    -ms-flex-order<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;ve included the <code>-ms</code> prefix to all these because Microsoft Internet Explorer 10+ is the only browser that has implemented the hybrid syntax. You can see that it has a mix of the legacy type and the modern type.</p>
<h3>Compatibility Chart</h3>
<style type="text/css"><!--
.table { border-collapse: collapse; }
.table th, td { border: 1px solid #939393; padding: 5px 10px; }
--></style>
<table class="table">
<tbody>
<tr>
<th>Chrome</th>
<th>Firefox</th>
<th>Safari</th>
<th>Internet Explorer</th>
</tr>
<tr>
<td>21+ Modern<br />
(with <code>-webkit</code> prefix)</td>
<td>22+ Modern<br />
(with <em>no prefix</em>)</td>
<td rowspan="2">Legacy<br />
(with <code>-webkit</code> prefix)</td>
<td>10+ Hybrid<br />
(with <code>-ms</code> prefix)</td>
</tr>
<tr>
<td>20- Legacy<br />
(with <code>-webkit</code> prefix)</td>
<td>21- Legacy<br />
(with <code>-moz</code> prefix)</td>
<td>9- <strong>NO</strong> support</td>
</tr>
</tbody>
</table>
<p>It&#8217;s worth it to note that Chrome v.21 came out in July of 2012 and Firefox v.22 is planned on being released later this month (6/2013). Also, while Firefox v.22 does support Modern flexbox, it doesn&#8217;t not support the <code>wrap</code> declaration.</p>
<h3>Compatibility How-To</h3>
<p>The differences between Modern Flexbox and Legacy Flexbox are pretty distinct, so we need a way to include all possible options to support as many browsers as possible. Doing so would look something like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -webkit-box<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Safari */</span> 
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-box<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Firefox 21- */</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -ms-flexbox<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* IE 10+ */</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -webkit-flex<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Chrome */</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> flex<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Standard (Firefox 22+) */</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    -webkit-box-ordinal-group<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Safari */</span>
    -moz-box-ordinal-group<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Firefox 21- */</span>
    -ms-flex-order<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Hybrid */</span>
    -webkit-order<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Chrome */</span>
    order<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Standard (Firefox 22+) */</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>CSS Preprocessors to the Rescue!</h3>
<p>Writing out 5 lines for each declaration you want to make can get tedious after a while, but CSS preprocessors make that a lot easier. I&#8217;ll be showing these examples using <a href="http://lesscss.org">LESS</a>, but there are probably ways to do this in any of the available preprocessors.</p>
<p>To do the basic <code>display: flex</code> declaration, you use a simple mixin.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">.flexbox<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* Legacy */</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -moz-box<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -webkit-box<span style="color: #00AA00;">;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">/* Hybrid */</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -ms-flexbox<span style="color: #00AA00;">;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">/* Modern */</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> -webkit-flex<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> flex<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    .flexbox<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Now when you want to use the <code>display: flex</code> declaration, you can just use <code>.flexbox()</code> instead.</p>
<p>If you want to use something with a variable, you can use pass that variable in as an argument for the mixin:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">.count<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@args) {</span>
    -webkit-box-ordinal-group<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@args;</span>
    -moz-box-ordinal-group<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@args;</span>
    -ms-flex-order<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@args;</span>
    -webkit-order<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@args;</span>
    order<span style="color: #00AA00;">:</span> <span style="color: #a1a100;">@args;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child1</span> <span style="color: #00AA00;">&#123;</span>
    .order<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.child2</span> <span style="color: #00AA00;">&#123;</span>
    .order<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>However, because the <code>flex-direction</code> is so different between Legacy and Modern, we have to use gated mixins</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">.flex-direction<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@value) when (@value = row) {</span>
    -webkit-box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span>
    -moz-box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span>
    -webkit-box-direction<span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    -moz-box-direction<span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    -ms-flex-direction<span style="color: #00AA00;">:</span> row<span style="color: #00AA00;">;</span>
    -webkit-flex-direction<span style="color: #00AA00;">:</span> row<span style="color: #00AA00;">;</span>
    flex-direction<span style="color: #00AA00;">:</span> row<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.flex-direction<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@value) when (@value = row-reverse) {</span>
    -webkit-box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span>
    -moz-box-orient<span style="color: #00AA00;">:</span> horizontal<span style="color: #00AA00;">;</span>
    -webkit-box-direction<span style="color: #00AA00;">:</span> reverse<span style="color: #00AA00;">;</span>
    -moz-box-direction<span style="color: #00AA00;">:</span> reverse<span style="color: #00AA00;">;</span>
    -ms-flex-direction<span style="color: #00AA00;">:</span> row-reverse<span style="color: #00AA00;">;</span>
    -webkit-flex-direction<span style="color: #00AA00;">:</span> row-reverse<span style="color: #00AA00;">;</span>
    flex-direction<span style="color: #00AA00;">:</span> row-reverse<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.flex-direction<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@value) when (@value = column) {</span>
    -webkit-box-orient<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
    -moz-box-orient<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
    -webkit-box-direction<span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    -moz-box-direction<span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
    -ms-flex-direction<span style="color: #00AA00;">:</span> column<span style="color: #00AA00;">;</span>
    -webkit-flex-direction<span style="color: #00AA00;">:</span> column<span style="color: #00AA00;">;</span>
    flex-direction<span style="color: #00AA00;">:</span> column<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
.flex-direction<span style="color: #00AA00;">&#40;</span><span style="color: #a1a100;">@value) when (@value = column-reverse) {</span>
    -webkit-box-orient<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
    -moz-box-orient<span style="color: #00AA00;">:</span> vertical<span style="color: #00AA00;">;</span>
    -webkit-box-direction<span style="color: #00AA00;">:</span> reverse<span style="color: #00AA00;">;</span>
    -moz-box-direction<span style="color: #00AA00;">:</span> reverse<span style="color: #00AA00;">;</span>
    -ms-flex-direction<span style="color: #00AA00;">:</span> column-reverse<span style="color: #00AA00;">;</span>
    -webkit-flex-direction<span style="color: #00AA00;">:</span> column-reverse<span style="color: #00AA00;">;</span>
    flex-direction<span style="color: #00AA00;">:</span> column-reverse<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    .flex-direction<span style="color: #00AA00;">&#40;</span>row<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;ll leave the rest of the declarations as an exercise to the reader, but that should give you a good start on how do implement a cross-browser flexbox solution.</p>
<h3>Conclusion</h3>
<p>The fact that any Internet Explorer less than 10 doesn&#8217;t support any form of the flexbox model means that if you want to use flexbox, you have to program a fallback using the old block/float methods, then program the flexbox stuff on top of that. That&#8217;s a lot of extra work, especially if they look pretty much the same in the end. So until IE &lt; 10 usage drops significantly (currently it&#8217;s around 10%) flexbox isn&#8217;t going to be the ideal solution. Check back in a year or so.</p>
<p>The post <a href="http://elikirk.com/2013/06/05/flexbox-css-cross-browser-issues/">Flexbox CSS Cross-browser Issues</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2013/06/05/flexbox-css-cross-browser-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flexbox CSS Tutorial</title>
		<link>http://elikirk.com/2013/06/05/flexbox-css-tutorial/</link>
		<comments>http://elikirk.com/2013/06/05/flexbox-css-tutorial/#comments</comments>
		<pubDate>Wed, 05 Jun 2013 19:09:01 +0000</pubDate>
		<dc:creator>Chris Rock</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Flexbox]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1845</guid>
		<description><![CDATA[<p>If you&#039;ve been in web development for a while, you&#039;ve known the struggles of getting a document layout to work just right. The problem is, HTML and CSS were developed with documents in mind, but creative web developers wanted to do more than just style documents, they wanted their websites to look and feel more [...]</p><p>The post <a href="http://elikirk.com/2013/06/05/flexbox-css-tutorial/">Flexbox CSS Tutorial</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>If you&#039;ve been in <strong>web development</strong> for a while, you&#039;ve known the struggles of getting a document layout to work just right. The problem is, HTML and CSS were developed with documents in mind, but creative web developers wanted to do more than just style documents, they wanted their websites to look and feel more like computer applications. Their first attempt at this was to lay out the entire site into tables within tables, but table-based layouts were unwieldy and semantically incorrect. Then they jerry-rigged the <code>float</code> property (with the useful <code>clear: both</code> style) to put document elements where they wanted them.  However, this has limitations, especially if you want to use a flexible layout.</p>
<p>For example, look at the following sample website:</p>
<p><img src="http://elikirk.com/wp-content/uploads/2013/06/flex-block-float-example.png" style="display: block; margin: 0 auto; box-shadow: 0 0 5px 0px #666;" /><br />
This is a pretty basic layout using blocks and <code>float</code>.  As you can see there are a couple of potential design problems here.  First, the footer isn&#8217;t at the bottom of the page.  Also, the sidebar content is shorter than the main content, so it doesn&#8217;t extend to the height of the main content and there&#8217;s some white space below it.</p>
<p>There are a few ways to fix these problems, but they generally involve less-than-ideal hacks.  Not to worry though, now we have a new way to do it: <strong>Flexbox</strong></p>
<h3>The Block Model vs Flexbox</h3>
<p>The main idea behind the block model was to have blocks of content flow one after the other in the document. (The <code>float</code> property was intended to be used if you had an image or side panel that would need to &#8220;float&#8221; to the side while the rest of the blocks flowed around it.) The size of the block is determined by the following:</p>
<ul>
<li>The width of the parent (unless the block has been given the <code>float</code> property, then it&#039;s the width of the content)</li>
<li>The height of the content</li>
<li>User specifications (e.g., <code>width: 100px</code>)</li>
</ul>
<p>Note that the block model only takes itself (and its parent) into consideration when determining its size.</p>
<p>The Flexbox model, on the other hand, takes the following things into consideration when determining the layout</p>
<ul>
<li>The width <em>and height</em> of the parent</li>
<li>The available space for each child element</li>
<li>The size of the other children it shares the space with</li>
<li>User specifications on how each child should use the space available</li>
<li>User specifications on the orientation of children</li>
<li>User specifications on how the children should be aligned</li>
<li>User specifications on the order the children should be arranged</li>
</ul>
<p>What are we waiting for? Let&#039;s see how to do this magic.</p>
<h3>Axes in Flexbox</h3>
<p>Hold your horses, we first need to get a couple of terms down.<br />
<img src="http://elikirk.com/wp-content/uploads/2013/06/flexbox-axes.png" /></p>
<ul>
<li><strong>Main axis</strong> &#8211; The axis along with the children are arranged</li>
<li><strong>Cross axis</strong> &#8211; The axis perpendicular to the main axis</li>
</ul>
<p>Now let&#039;s talk about how to make this work.</p>
<h3>Flexbox CSS &#8211; Parent style declarations</h3>
<p>Flexbox CSS style declarations go in one of two places, the parent container or the child (immediate children only).  Let&#8217;s look at the parent first.</p>
<h4>The main declaration</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> flex<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>First, we need to tell the container to display itself as a flexbox. This is really simple.</p>
<h4>Orientation and Direction</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    flex-direction<span style="color: #00AA00;">:</span> row<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    flex-direction<span style="color: #00AA00;">:</span> row-reverse<span style="color: #00AA00;">;</span>
    flex-direction<span style="color: #00AA00;">:</span> column<span style="color: #00AA00;">;</span>
    flex-direction<span style="color: #00AA00;">:</span> column-reverse<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The are an number of options you can choose to orient the direct children of the parent flexbox.</p>
<ul>
<li><code>row</code> will arrange the child block horizontally across the screen, left to right</li>
<li><code>row-reverse</code> will arrange them horizontally and order them from right to left</li>
<li><code>column</code> will arrange them vertically down the screen top to bottom</li>
<li><code>column-reverse</code> will arrange them vertically and order them from bottom to top</li>
</ul>
<p>In other words, the reverse option switches the main-start and main-end positions (see the axes diagram above).</p>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-row.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>row</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-row-reverse.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>row-reverse</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-column.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>column</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-column-reverse.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>column-reverse</code></p>
</div>
<h4>Wrap</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    flex-wrap<span style="color: #00AA00;">:</span> <span style="color: #993333;">nowrap</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    flex-wrap<span style="color: #00AA00;">:</span> wrap<span style="color: #00AA00;">;</span>
    flex-wrap<span style="color: #00AA00;">:</span> wrap-reverse<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Wrap will try to fit the content into multiple rows (it seems to only work on <code>flex-direction: row</code> at this time).  Wrap-reverse will align the element from bottom to top rather than from top to bottom.  In this case, the reverse option switches the cross-start and cross-end positions (see the axes diagram above).</p>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-wrap.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>wrap</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-wrap-reverse.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>wrap-reverse</code></p>
</div>
<h4>Justify Content &#8211; The Alignment and Position on the Main Axis</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    justify-content<span style="color: #00AA00;">:</span> flex-start<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    justify-content<span style="color: #00AA00;">:</span> flex-end<span style="color: #00AA00;">;</span>
    justify-content<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
    justify-content<span style="color: #00AA00;">:</span> space-between<span style="color: #00AA00;">;</span>
    justify-content<span style="color: #00AA00;">:</span> space-around<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This declaration determines how the leftover space will be allocated along the main axis.</p>
<ul>
<li><code>flex-start</code> puts all the content at the beginning and the extra space goes at the end.</li>
<li><code>flex-end</code> puts all the content at the end and the leftover space is put at the beginning.</li>
<li><code>center</code> puts the extra space on both sides of the content.</li>
<li><code>space-between</code> puts content flush at each end, then distributes the extra space between the other pieces of content.</li>
<li><code>space-around</code> is like <code>space-between</code> except that the space is also distributed before and after the first and last pieces of content</li>
</ul>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-justify-end.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>flex-end</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-justify-center.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>center</code></p>
</div>
<div style="clear: both;"></div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-justify-between.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>space-between</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-justify-around.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>space-around</code></p>
</div>
<h4>Align Items &#8211; The Alignment and Position on the Cross Axis</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.parent</span> <span style="color: #00AA00;">&#123;</span>
    align-items<span style="color: #00AA00;">:</span> stretch<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*default */</span>
    align-items<span style="color: #00AA00;">:</span> flex-start<span style="color: #00AA00;">;</span>
    align-items<span style="color: #00AA00;">:</span> flex-end<span style="color: #00AA00;">;</span>
    align-items<span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
    align-items<span style="color: #00AA00;">:</span> <span style="color: #993333;">baseline</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This declaration determines how the leftover space will be allocated along the cross axis.</p>
<ul>
<li><code>stretch</code> completely fills the length of the cross axis (height for <code>row</code> or width for <code>column</code>)</li>
<li><code>flex-start</code> puts all the content at the start of the cross axis</li>
<li><code>flex-end</code> puts all the content at the end of the cross axis</li>
<li><code>center</code> puts all the content at the center of the cross axis, with the extra space equal on either side</li>
<li><code>baseline</code> lines up the content with the first text line of each block of content</li>
</ul>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-align-start.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>flex-start</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-align-end.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>flex-end</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-align-center.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>center</code></p>
</div>
<div style="width: 290px; float: left; text-align: center;">
    <img src="http://elikirk.com/wp-content/uploads/2013/06/flex-example-align-baseline.png" style="box-shadow: 0 0 5px 0 #666;" /></p>
<p><code>baseline</code><br /><span style="font-size: 75%;">(shown with <code>flex-direction: row</code>)</span></p>
</div>
<h3>Flexbox CSS &#8211; Child Style Declarations</h3>
<p>These are style declarations that you need to add to the children of the parent flexbox element.  You can add it to one or all of them&#8211;if you don&#039;t it uses the default attributes.</p>
<h4>Flex Grow</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    flex-grow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    flex-grow<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
    flex-grow<span style="color: #00AA00;">:</span> n<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Assigning a number to <code>flex-grow</code> tells the browser, &#8220;If there is any extra space, give it to this element.&#8221;  It also divides the space proportionally between the elements based on the number (e.g., if one child is marked &#8220;2&#8243; and the other is marked &#8220;1&#8243; then twice as much space is given to the first one).  If two elements have the same number it will divide the leftover space equally between them.</p>
<h4>Flex Shrink</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    flex-shrink<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
    flex-shrink<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    flex-shrink<span style="color: #00AA00;">:</span> n<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This works a lot like <code>flex-grow</code>. If marked with anything other than &#8220;0&#8243;, it tells the browser, &#8220;If there&#039;s not enough space for all of us to fit, then you can shrink the size of this element.&#8221;  Notice that the default is &#8220;1&#8243; whereas the default for <code>flex-grow</code> is &#8220;0&#8243;.  This means that elements will not grow but default, but they will shrink.</p>
<h4>Flex Basis</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    flex-basis<span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    flex-basis<span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> 
    flex-basis<span style="color: #00AA00;">:</span> <span style="color: #933;">10%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>If this declaration has any value other than &#8220;auto&#8221;, it tells the browser, &#8220;Before you grow or shrink me, I want you to disregard my actual content size and think of my size as being this.&#8221;</p>
<h4>Order</h4>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.child</span> <span style="color: #00AA00;">&#123;</span>
    order<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* default */</span>
    order<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
    order<span style="color: #00AA00;">:</span> n<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>This is one of the most interesting aspects of the flexbox model. You can order the elements of flexbox children, regardless of their order in the code.</p>
<h3>Conclusion</h3>
<p>Who would need to use flexbox? I see flexbox working best for flexible, responsive designs.  This is especially the case with mobile sites&#8211;most especially with sites have more of a &#8220;web-app&#8221; look and feel.  The idea is that you want to fill the entire screen, no matter what the screen size is.  Flexbox is perfect for that sort of thing.</p>
<p>Now for the bad news.  Currently (6/2013&#8211;the time this post was written) the state of flexbox is kind of a mess. Not many browsers support it and those that do support an older version of the spec.  In another post I talk about how to deal with <a href="http://elikirk.com/2013/06/05/flexbox-css-cross-browser-issues/">cross-browser flexbox CSS issues</a>, so be sure to check that out.</p>
<p>The post <a href="http://elikirk.com/2013/06/05/flexbox-css-tutorial/">Flexbox CSS Tutorial</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2013/06/05/flexbox-css-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Sprite-based Animation with PNGs to Create Animated Graphs</title>
		<link>http://elikirk.com/2013/05/20/simple-sprite-based-animation-with-pngs-to-create-animated-graphs/</link>
		<comments>http://elikirk.com/2013/05/20/simple-sprite-based-animation-with-pngs-to-create-animated-graphs/#comments</comments>
		<pubDate>Mon, 20 May 2013 21:42:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[sprite]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1837</guid>
		<description><![CDATA[<p>Here at Eli Kirk, we&#039;re always looking for ways to design eye-catching web experiences and that usually involves animation. As web developers we get the exciting job of making those animations work. A great example is a recent client Align B.I.. The designers wanted an animated circular graph. While most animation on the web is [...]</p><p>The post <a href="http://elikirk.com/2013/05/20/simple-sprite-based-animation-with-pngs-to-create-animated-graphs/">Simple Sprite-based Animation with PNGs to Create Animated Graphs</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Here at Eli Kirk, we&#039;re always looking for ways to design eye-catching web experiences and that usually involves animation. As <strong>web developers</strong> we get the exciting job of making those animations work.</p>
<p>A great example is a recent client <a href="http://alignbi.com">Align B.I.</a>. The designers wanted an animated circular graph.  While most animation on the web is based on the concept of moving elements around, this is an element that stays in one place.</p>
<p>The way we ended up doing this was to use an <strong>animated sprite</strong>.  The idea is simple&#8211;we set up an interval and at each step move the sprite to the next frame.</p>
<h3>Setting up the Sprite</h3>
<p>First we need an image.</p>
<p><a href="http://elikirk.com/wp-content/uploads/2013/05/badge-indicator.png" target="_blank"><img src="http://elikirk.com/wp-content/uploads/2013/05/badge-indicator.png" alt="Sprite used for animation" width="580" /></a></p>
<p>If you click on this image, you&#039;ll notice that it&#039;s really, really long. 16340px. Wow. Each frame for our animation is going to be 380&#215;340 and there are 43 frames.</p>
<p>So we create a box with our sprite for a background image.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;graph&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.graph</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>&amp;<span style="color: #cc00cc;">#039</span><span style="color: #00AA00;">;</span>/image/location.png&amp;<span style="color: #cc00cc;">#039</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">360px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">340px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Using jQuery for Simple Animation</h3>
<p>Of course, we need some javascript to do the actual animation. We&#039;ll do this by setting an interval that will call a function that moves the background image to the next frame every 40 milliseconds.  Once it gets to the end of the image, it will clear the interval so that it&#039;s not called any more.  Two global variables will make this easier&#8211;one for the current position of the sprite and one for the variable that will store the interval.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> graphBGPosition <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">var</span> graphAnimate<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">function</span> drawGraph<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    graphBGPosition <span style="color: #339933;">-=</span> <span style="color: #CC0000;">380</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span>.<span style="color: #660066;">graph</span><span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span>background<span style="color: #339933;">-</span>position<span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;,</span> graphBGPosition <span style="color: #339933;">+</span> <span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span>px 0px<span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>graphBGPosition <span style="color: #339933;">&lt;=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">15960</span><span style="color: #009900;">&#41;</span> clearInterval<span style="color: #009900;">&#40;</span>graphAnimate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Next, we something to start the interval and get the animation going.  For this example, I made a simple button that would start the animation when it&#039;s pressed, and then assigned a listener to it with some simple <a href="http://jquery.com">jQuery</a>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;button-start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Start Animation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/button<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #000066; 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: #339933;">&amp;</span>#039<span style="color: #339933;">;</span>.<span style="color: #660066;">button</span><span style="color: #339933;">-</span>start<span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;</span>click<span style="color: #339933;">&amp;</span>#039<span style="color: #339933;">;,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Reset in case it&amp;#039;s in the middle of animating</span>
	clearInterval<span style="color: #009900;">&#40;</span>graphAnimate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	graphBGPosition <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #006600; font-style: italic;">// Do the animation</span>
	graphAnimate <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span>drawGraph<span style="color: #339933;">,</span> <span style="color: #CC0000;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The post <a href="http://elikirk.com/2013/05/20/simple-sprite-based-animation-with-pngs-to-create-animated-graphs/">Simple Sprite-based Animation with PNGs to Create Animated Graphs</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2013/05/20/simple-sprite-based-animation-with-pngs-to-create-animated-graphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Fiber is coming to Provo</title>
		<link>http://elikirk.com/2013/04/24/google-fiber-is-coming-to-provo/</link>
		<comments>http://elikirk.com/2013/04/24/google-fiber-is-coming-to-provo/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 21:50:27 +0000</pubDate>
		<dc:creator>Seth Taylor</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Infographic]]></category>
		<category><![CDATA[Provo]]></category>
		<category><![CDATA[Utah]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1805</guid>
		<description><![CDATA[<p>We&#039;re excited to have a future-ready sandbox to play in, to create, and to fulfill. Unbridled Innovation for Provo Businesses There’s no doubt the buzz about Google dubbing Provo its new fibertown has entrepreneurs—with bags packed—en route to the Silicon Slopes. Why? Because having speeds of 1 gigabit per second means businesses can disseminate information [...]</p><p>The post <a href="http://elikirk.com/2013/04/24/google-fiber-is-coming-to-provo/">Google Fiber is coming to Provo</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>We&#039;re excited to have a future-ready sandbox to play in, to create, and to fulfill.</p>
<p><img class="alignnone size-full wp-image-1806" alt="benefitsOfGoogleFiber_EliKirk" src="http://elikirk.com/wp-content/uploads/2013/04/benefitsOfGoogleFiber_EliKirk.jpg" width="640" height="3506" /></p>
<p><b><i>Unbridled Innovation for Provo Businesses</i></b></p>
<p>There’s no doubt the buzz about Google dubbing Provo its new fibertown has entrepreneurs—with bags packed—en route to the Silicon Slopes. Why? Because having speeds of 1 gigabit per second means businesses can disseminate information as quickly as they can produce it. And anyone within the Google Fiber network can receive that information without any barrier of bandwidth. In a playground with augmented connectivity, innovation is unbridled, and that gives Utah Valley the competitive advantage in attracting business to the area.</p>
<div></div>
<p><b><i>Equal Opportunity for Provo Families</i></b></p>
<p>With Google vowing free 5 Mbps to all homes on the iProvo network for a $30 activation fee and no monthly charge for seven years, educational opportunities for local families will skyrocket. For some this announcement of acceleration means having an Internet connection in their home for the very first time, giving families and individuals alike equal opportunities to learn and create. Here’s the reality: Provo is set to be one of first cities where universal internet connectivity will abound. Residents will be able access new kinds of content, at unprecedented speeds—everywhere.</p>
<p>More information can be found <a href="https://fiber.google.com/cities/provo/">here</a>.</p>
<p>The post <a href="http://elikirk.com/2013/04/24/google-fiber-is-coming-to-provo/">Google Fiber is coming to Provo</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2013/04/24/google-fiber-is-coming-to-provo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX-ifying WordPress &#8211; Creating a one-page experience with WordPress</title>
		<link>http://elikirk.com/2012/12/28/ajax-ifying-wordpress-creating-a-one-page-experience-with-wordpress/</link>
		<comments>http://elikirk.com/2012/12/28/ajax-ifying-wordpress-creating-a-one-page-experience-with-wordpress/#comments</comments>
		<pubDate>Fri, 28 Dec 2012 23:55:11 +0000</pubDate>
		<dc:creator>Chris Rock</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[one-page]]></category>
		<category><![CDATA[php output buffers]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1675</guid>
		<description><![CDATA[<p>The Challenge Recently a client of ours, Collection Brokerage, came to us who wanted the easy-to-use WordPress system to manage a stylish, one-page website design. In order to get WordPress to do this, we needed to overcome a couple of challenges for web development: Header and footer stay fixed, main content and sidebar content are [...]</p><p>The post <a href="http://elikirk.com/2012/12/28/ajax-ifying-wordpress-creating-a-one-page-experience-with-wordpress/">AJAX-ifying WordPress &#8211; Creating a one-page experience with WordPress</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<h3>The Challenge</h3>
<p>Recently a client of ours, <a href="http://collectionbrokerage.com/">Collection Brokerage</a>, came to us who wanted the easy-to-use WordPress system to manage a stylish, <strong>one-page website design</strong>.  In order to get WordPress to do this, we needed to overcome a couple of challenges for <strong>web development</strong>:</p>
<ul>
<li>Header and footer stay fixed, main content and sidebar content are replaced</li>
<li>Deep-linkable</li>
<li>URL changes to reflect page you&#8217;re on</li>
</ul>
<p>Because we wanted to make this site deep-linkable, meaning that if you navigated to a specific page, even though it would be loaded via AJAX, you could still go directly to that page with a simple URL.  In other words, we could be coming to this page from two different methods</p>
<ul>
<li><strong>Natural URL</strong> &#8211; Load the entire page, including the header and footer.</li>
<li><strong>AJAX</strong> &#8211; All internal links will only change the main content area (leaving the header and footer)</li>
</ul>
<h3>WordPress Template System</h3>
<p>WordPress comes with a great template system built in. The hierarchy allows us to build page templates that have automatic fallbacks.  If you&#8217;re unfamiliar with this system, check out the <a href="http://codex.wordpress.org/Template_Hierarchy">documentation for the WordPress template hierarchy</a>.</p>
<h3>Partial Templates in WordPress</h3>
<p>In a standard WordPress template, you include all the pieces&#8211;the header, footer, sidebar, and the main content.  However, in this situation we will be pulling the main content from two different sources.  In order to not repeat our code, we&#8217;ll abstract it into a partial template using the WordPress function <code>locate_template</code>.</p>
<p>The <a href="http://codex.wordpress.org/Function_Reference/locate_template"><code>locate_template</code></a> function is pretty powerful function. It allows us to specify a template to load, as well as any fallback templates if that specific template isn&#8217;t found</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">locate_template<span style="color: #009900;">&#40;</span>
    <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'specific-template.php'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'fallback-template.php'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'generic-template.php'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #666666; font-style: italic;">// Array of templates to look for </span>
    <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// echo the output?</span>
    <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #666666; font-style: italic;">// require_once?</span>
<span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>The easiest way to implement this function is to create a generic <code>page.php</code> template that calls partial templates for the main content based on the slug id of that page. The heirarchy would be something like this:</p>
<ul>
<li>page.php
<ul>
<li>main-aboutus.php</li>
<li>main-contact.php</li>
</ul>
</ul>
<p>The code for the <code>page.php</code> file would look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div class=&quot;main&quot;&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> 
            <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$slug</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_name</span><span style="color: #339933;">;</span>
            locate_template<span style="color: #009900;">&#40;</span>
                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                    <span style="color: #0000ff;">&quot;main-<span style="color: #006699; font-weight: bold;">$slug</span>.php&quot;</span><span style="color: #339933;">,</span>
                    <span style="color: #0000ff;">'main-main.php'</span>
                <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Accessing WordPress Pages Through AJAX</h3>
<p>Now we need to access the content trough AJAX.  First we&#8217;ll need an AJAX call that will call a custom file called <code>ajax-page-fetch.php</code> (passing it the URL) which will pull the proper HTML, then return it in a JSON object to be inserted into the right place on the page.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Only run on internal links</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[href*=&quot;mydomain.example.com&quot;]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    linkUrl <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;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        url<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/wp-content/themes/myTheme/ajax-page-fetch.php'</span><span style="color: #339933;">,</span>
        data<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span> url<span style="color: #339933;">:</span> linkUrl <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        dataType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'json'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// I find JSON to be most versatile</span>
        success<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.main'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">pagehtml</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: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Page Fetch Script</h3>
<p>When WordPress is building a normal page, it first checks the <code>$_SERVER['REQUEST_URI']</code> variable for the page URL and then builds the page.  In order to use the cool WordPress page-specific functions (such as <code>is_home()</code>, or <code>has_posts()</code>), we&#8217;ll need to trick WordPress into thinking this page was called naturally.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Remove domain name</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'http://'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
    <span style="color: #000088;">$url</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now we can load WordPress and this script will be able to use all the WordPress functions, including any that would be specific to that page. We do that with the <code>wp()</code> function.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-load.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
wp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Load Wordpress</span></pre></td></tr></table></div>

<h3>PHP Output Buffers</h3>
<p>Now we simply have to send the proper content back. We do that by using PHP object buffers.  Object buffers collect anything echoed out which can then be put into a single variable using the <code>ob_get_contents()</code> function.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Start buffer</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</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>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$slug</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_name</span><span style="color: #339933;">;</span>
        locate_template<span style="color: #009900;">&#40;</span>
            <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;main-<span style="color: #006699; font-weight: bold;">$slug</span>.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'main-main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #009900; font-weight: bold;">true</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: #000088;">$page_template</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ob_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Put buffer contents into variable</span>
<span style="color: #990000;">ob_end_clean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Stop buffer</span></pre></td></tr></table></div>

<p>Now that we got the content in a variable, we can send it back in the format that&#8217;s expected&#8211;in this case, JSON.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'pagehtml'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$page_template</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>URL History</h3>
<p>To change the URL when changing pages, we used the super-useful <a href="https://github.com/balupton/History.js/">jQuery History</a> plugin.  We simply added it to our AJAX call.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">History.<span style="color: #660066;">pushState</span><span style="color: #009900;">&#40;</span>
    <span style="color: #009900;">&#123;</span>state<span style="color: #339933;">:</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// output to console.log</span>
    <span style="color: #3366CC;">&quot;State 1&quot;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// internal name</span>
    <span style="color: #3366CC;">&quot;?state=1&quot;</span> <span style="color: #006600; font-style: italic;">// url</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Conclusion</h3>
<p>This is an extremely over-simplified example.  Our <a href="http://collectionbrokerage.com/">actual implementation</a> was much more complicated, involving getting content for the sidebar, and displaying some pages (such as the blog page and archive pages) as a listing of posts.  However, this should be enough to get you started.  Here are a couple of other points to consider when making a page like this:</p>
<ul>
<li>Include a &#8220;loading&#8221; gif</li>
<li>Put page-specific javascript into the page itself.</li>
<li>Remember to deal with menu active states</li>
<li>Pass more info through your JSON string if needed (page id, parent id, title, etc.)</li>
<li>Some plugins may need their javascript to be reloaded. (I&#8217;m looking at you Contact Form 7)</li>
</ul>
<p>The post <a href="http://elikirk.com/2012/12/28/ajax-ifying-wordpress-creating-a-one-page-experience-with-wordpress/">AJAX-ifying WordPress &#8211; Creating a one-page experience with WordPress</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2012/12/28/ajax-ifying-wordpress-creating-a-one-page-experience-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remember calls to action&#8230; You still need to ask for the business.</title>
		<link>http://elikirk.com/2012/12/13/calls-to-action/</link>
		<comments>http://elikirk.com/2012/12/13/calls-to-action/#comments</comments>
		<pubDate>Thu, 13 Dec 2012 06:07:42 +0000</pubDate>
		<dc:creator>Bill Brady</dc:creator>
				<category><![CDATA[Strategy]]></category>
		<category><![CDATA[Strategy, Employee]]></category>
		<category><![CDATA[calls to action]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[CTA]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1626</guid>
		<description><![CDATA[<p>Selling shoes as a teenager, I learned how important it was to ask for the business. My boss—who also taught my first primer on features, advantages and benefits—drilled an important lesson into me: &#8220;There is never a sale until you ask for the business.&#8221; I remember learning the art of closing as I practiced different [...]</p><p>The post <a href="http://elikirk.com/2012/12/13/calls-to-action/">Remember calls to action&#8230; You still need to ask for the business.</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Selling shoes as a teenager, I learned how important it was to ask for the business. My boss—who also taught my first primer on features, advantages and benefits—drilled an important lesson into me: &#8220;There is never a sale until you ask for the business.&#8221; I remember learning the art of closing as I practiced different ways to move the shoe customer from &#8220;tryer&#8221; to buyer.</p>
<p>I didn&#8217;t know it then, but I was learning how to make calls to action, or &#8220;CTAs,&#8221; as they&#8217;re known in marketing parlance.</p>
<p>Online, &#8220;asking for the business&#8221; also occurs through calls to action. Whether you want the user to learn, download, view, try, compare or buy, conversion is contingent on a CTA that incites the user to click. Unfortunately, calls to action are frequently underplanned and end up being mediocre, and thus underwhelming in their results.</p>
<p>Make planning for calls to action part of your user experience strategy and part of your copy writing. The funnel and flow of your website need to be well thought out before design ever starts, and a conversion-minded copy writer should be articulating your CTAs. Regardless of how well your content is written or how engaging your site design is, you still need to artfully craft and strategically place calls to action that will guide your user toward your desired outcome.</p>
<p>To help the budding shoe salesman in all of us, here&#8217;s a <a title="101 Great Calls to Action" href="http://bit.ly/Ny0GrS" target="_blank">great exploration of effective calls to action</a> from our friends at HubSpot. If you feel inspired and want to polish the calls to action on your site, please <a href="mailto:bill@elikirk.com" target="_blank">reach me</a> to schedule a complimentary brainstorm session.</p>
<p>&nbsp;</p>
<p>The post <a href="http://elikirk.com/2012/12/13/calls-to-action/">Remember calls to action&#8230; You still need to ask for the business.</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2012/12/13/calls-to-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now Hiring: Senior Web Developer (Front-End)</title>
		<link>http://elikirk.com/2012/12/12/now-hiring-senior-web-developer-front-end/</link>
		<comments>http://elikirk.com/2012/12/12/now-hiring-senior-web-developer-front-end/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 23:37:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Job Opening]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1658</guid>
		<description><![CDATA[<p>We are seeking a senior level front-end web developer to work as a lead resource on one of our development teams.  This role will focus primarily on front-end development (HTML5, CSS3 and Javascript), yet it will include some back-end coding in either PHP or Java. Responsibilities Front-end web development using HTML5, CSS3 and Javascript. Work [...]</p><p>The post <a href="http://elikirk.com/2012/12/12/now-hiring-senior-web-developer-front-end/">Now Hiring: Senior Web Developer (Front-End)</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>We are seeking a senior level front-end web developer to work as a lead resource on one of our development teams.  This role will focus primarily on front-end development (HTML5, CSS3 and Javascript), yet it will include some back-end coding in either PHP or Java.</p>
<h2>Responsibilities</h2>
<ul>
<li dir="ltr">Front-end web development using HTML5, CSS3 and Javascript.</li>
<li dir="ltr">Work closely with UX designers, project managers and customers.</li>
<li dir="ltr">Build HTML templates for other team members and define template guidelines.</li>
<li dir="ltr">Manage and train junior/entry level developers implementing templates.</li>
<li dir="ltr">Enforce web standards compliance and industry best practices.</li>
<li dir="ltr">Introduce and implement innovative techniques and technologies.</li>
<li dir="ltr">Cross-platform and cross-browser testing.</li>
</ul>
<h2>Requirements</h2>
<ul>
<li dir="ltr">Expert with HTML5, CSS3, and JavaScript.</li>
<li dir="ltr">Advanced JavaScript knowledge including frameworks such as JQuery.</li>
<li dir="ltr">Ability to work with Adobe Creative Suite files like Photoshop, Illustrator and Fireworks to cut images from design files.</li>
<li dir="ltr">Obsessive attention to detail, ensuring that website matches design pixel per pixel.</li>
<li dir="ltr">Experience with either PHP or Java.</li>
<li dir="ltr">Experience working with databases like MYSQL.</li>
<li dir="ltr">Ability to multi-task, and work under pressure.</li>
<li dir="ltr">Motivated to research and learn about new technologies and practices.</li>
<li dir="ltr">Work on-site in Provo, Utah.  This is not a telecommuting job.</li>
</ul>
<h2>Compensation</h2>
<p>Salary will be negotiated commensurate with experience.  Health insurance, including HSA, will be available following one full calendar month of employment. No relocation package is offered with this position.</p>
<h2>Application</h2>
<p>Submit a resume and cover letter to Jarid Love at <a href="mailto:bill@elikirk.com">jarid@elikirk.com</a>. Employment and character references should also be included.</p>
<p>The post <a href="http://elikirk.com/2012/12/12/now-hiring-senior-web-developer-front-end/">Now Hiring: Senior Web Developer (Front-End)</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2012/12/12/now-hiring-senior-web-developer-front-end/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Cookies</title>
		<link>http://elikirk.com/2012/12/12/javascript-cookies/</link>
		<comments>http://elikirk.com/2012/12/12/javascript-cookies/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 16:47:07 +0000</pubDate>
		<dc:creator>roy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1594</guid>
		<description><![CDATA[<p>The other day, a client asked for a new modal popup to show on one of their pages.  The page was an interactive product display with filters and features that respond to the shopper with information making it app-like.  Here is what they needed. 1.  Popup needed to load on first visit at page load. [...]</p><p>The post <a href="http://elikirk.com/2012/12/12/javascript-cookies/">Javascript Cookies</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><img class=" wp-image-1603" style="margin: 5px;" title="cookies" src="http://elikirk.com/wp-content/uploads/2012/12/cookies.jpg" alt="" width="200" height="150" align="left" /></p>
<p>The other day, a client asked for a new modal popup to show on one of their pages.  The page was an interactive product display with filters and features that respond to the shopper with information making it app-like.  Here is what they needed.</p>
<p>1.  Popup needed to load on first visit at page load.</p>
<p>2.  Not reload each time the page changed</p>
<p>3.  Act like all of the other similar popup modals on the page.</p>
<p>Launching when the page loads was easy enough.  We are using jQuery and it was simple to place this inside a jQuery(document.ready function(){&#8230;}); and let it roll.  But we needed to also limit it to display only once when the user was on the page and not every time an event reloaded the page.  To do this, I decided to use a session cookie.  This would allow me to tell when someone had already visited the page and not re-display the information.</p>
<p>So I downloaded and added the<a href="https://github.com/carhartl/jquery-cookie"> jQuery-Cookie</a> plugin.  (I had to download it as it is not yet part of the standard jQuery.) Add the reference to the cookie.js in the header, and then add this code to the page that needed the feature.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery<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: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">//lets see if we can have this only once per visit.</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'announcement'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//if the cookie is not missing</span>
        <span style="color: #006600; font-style: italic;">//javascript to display my content in the modal popup</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">var</span> date <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> <span style="">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">// calculate the date.</span>
        <span style="color: #000066; font-weight: bold;">var</span> minutes <span style="color: #339933;">=</span> <span style="color: #CC0000;">15</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">// I only want the cookie to last 15 minutes.</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>minutes <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: #006600; font-style: italic;">// do some math to get the right number of seconds.</span>
&nbsp;
        $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'announcement'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> expires<span style="color: #339933;">:</span> date <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">// sets the cookie so that it expires in 15 minutes.</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//some other code to make stuff happen specific to my popup modal,</span>
<span style="color: #006600; font-style: italic;">//but not related to this post.</span></pre></td></tr></table></div>

<p>Now when someone comes to this page for the first time, they see the desired message in the modal popup. If they do their searching and filtering and other interactive actions within 15 minutes. (which is likely for this page.) Then they won&#8217;t see the message again.</p>
<p>But if they leave and come back 15 minutes later. (like after checking out.) Then they will see the message again.</p>
<p>I could have put some javascript to expire the cookie on the next page, but it seemed a bit of overkill as there are multiple next pages that could be, and this works.  And I needed the expiration anyway so it seemed like an easy way to do both.</p>
<p>The post <a href="http://elikirk.com/2012/12/12/javascript-cookies/">Javascript Cookies</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2012/12/12/javascript-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Sitemap for your Magento based store</title>
		<link>http://elikirk.com/2012/11/30/create-a-sitemap-for-your-magento-based-store/</link>
		<comments>http://elikirk.com/2012/11/30/create-a-sitemap-for-your-magento-based-store/#comments</comments>
		<pubDate>Fri, 30 Nov 2012 22:20:00 +0000</pubDate>
		<dc:creator>roy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[sitemap]]></category>

		<guid isPermaLink="false">http://elikirk.com/?p=1579</guid>
		<description><![CDATA[<p>You won&#8217;t think about this too often, but when you setup your store, you need to create a sitemap.  And its a good idea to tell Google where it is. Luckily for you, Magento will create your sitemap, and keep it updated for you.  But you have to tell it to do this. So lets [...]</p><p>The post <a href="http://elikirk.com/2012/11/30/create-a-sitemap-for-your-magento-based-store/">Create a Sitemap for your Magento based store</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>You won&#8217;t think about this too often, but when you setup your store, you need to create a sitemap.  And its a good idea to tell Google where it is. Luckily for you, Magento will create your sitemap, and keep it updated for you.  But you have to tell it to do this.</p>
<p>So lets get started.</p>
<p>First you login to the admin pannel for your magento store.  Navigate to Catalog &gt; Google Sitemap.  It should be the last option on the drop down menu.</p>
<p>&nbsp;</p>
<p><a href="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.00.54-PM.png" rel="prettyPhoto[g1579]"><img class="alignnone size-full wp-image-1580" title="sitemap nav" src="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.00.54-PM.png" alt="" width="361" height="255" /></a></p>
<p>Now you will see a page that says Google Sitemaps on the left and a Add Sitemap on the right.  If you already have a sitemap, they will be listed here.</p>
<p><a href="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.01.29-PM.png" rel="prettyPhoto[g1579]"><img class="alignnone size-full wp-image-1581" title="Google Sitemap" src="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.01.29-PM.png" alt="" width="179" height="215" /></a>     &#8212;-   <a href="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.01.40-PM.png" rel="prettyPhoto[g1579]"><img class="alignnone size-full wp-image-1582" title="Add Sitemap" src="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.01.40-PM.png" alt="" width="207" height="230" /></a></p>
<p>&nbsp;</p>
<p>To add a sitemap, click on the &#8220;Add Sitemap&#8221; button.  This will take you to a simple form to fill in.</p>
<p><a href="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.02.15-PM.png" rel="prettyPhoto[g1579]"><img class="alignnone size-full wp-image-1583" title="New Sitemap Form" src="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.02.15-PM.png" alt="" width="500" height="203" /></a></p>
<p>There really isn&#8217;t any reason to be creative here.  I just call my sitemaps &#8220;sitemap.xml&#8221; and recomend that you do the same.</p>
<p>Also, its a good idea to put your sitemap at the root of your website, so just use &#8220;/&#8221; as the path.  This will let any search engine find it if they come looking.</p>
<p>Now click save, and you will see the sitemap information in the table.  But we aren&#8217;t quite done.</p>
<p><a href="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.03.46-PM.png" rel="prettyPhoto[g1579]"><img class="alignnone size-full wp-image-1584" title="Generate Sitemap" src="http://elikirk.com/wp-content/uploads/2012/11/Screen-Shot-2012-11-30-at-3.03.46-PM.png" alt="" width="162" height="199" /></a></p>
<p>On the left of the sitemap record, there is a link called &#8220;Generate&#8221;  Click this link and Magento will generate the sitemap file for you.</p>
<p>Now you are done.</p>
<p>If you are interested, you can click on the now active url to the sitemap and you can see the xml in your browser.  Basically this tells a search engine where all of your pages are so that it can be indexed more quickly without requiring the search engine spiders to crawl all over your site to find out what is there.</p>
<p>&nbsp;</p>
<p>The post <a href="http://elikirk.com/2012/11/30/create-a-sitemap-for-your-magento-based-store/">Create a Sitemap for your Magento based store</a> appeared first on <a href="http://elikirk.com">Eli Kirk</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://elikirk.com/2012/11/30/create-a-sitemap-for-your-magento-based-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
new