<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">Filament Group, Inc: Lab</title>
    <subtitle type="text">Lab:What we&apos;re thinking at Filament Group</subtitle>
    <link rel="alternate" type="text/html" href="/lab" />
    <link rel="self" type="application/atom+xml" href="http://filamentgroup.com/lab/atom/" />
    <updated>2012-05-15T15:26:15Z</updated>
    <rights>Copyright (c) 2012, Scott</rights>
    <generator uri="http://expressionengine.com/" version="1.6.1">ExpressionEngine</generator>
    <id>tag:,2012:03:29</id>


    <entry>
      <title>Device &amp;amp; browser quirks: tracking the weirdness</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/tracking_the_weirdness/" />
      <id>tag:,2012:/lab/6.139</id>
      <published>2012-03-29T07:15:00Z</published>
      <updated>2012-05-15T15:26:15Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="css"
        scheme="http://filamentgroup.com/lab/tag/css/"
        label="css" />
      <category term="javascript"
        scheme="http://filamentgroup.com/lab/tag/javascript/"
        label="javascript" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Scott on 03/29/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/css/" rel="tag">css</a></dd><dd><a href="http://filamentgroup.com/lab/tag/javascript/" rel="tag">javascript</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd>
				</dl>
						<p>We do a lot of browser testing, and we often see ourselves and others running into buggy behavior without knowing if an issue is already known, or perhaps if a workaround is available. Problem is, there's no good place (that we know of) to easily search for known HTML, CSS, and JS quirks and bugs in browsers &#8211; particularly issues that occur in mobile devices, or require more explanation than a simple, "feature xyz isn't supported in browser xyz."</p> 

<p> The <a href="https://github.com/scottjehl/Device-Bugs/issues">Device Bugs project on Github</a> is an attempt to address this problem. It's an open, generic bug tracker where we can keep track of the browser issues we commonly face, and make note of various related information and workarounds. While it'd be silly to suggest that it could ever be comprehensive, we think there's a good chance for it to become a useful resource &#8211; especially with the help of the broader community. As such, we've begun filing some of our favorite quirks, and we hope you will too!</p>

<p>While Device Bugs is a normal Github project, it is only meant to be used via its issue tracker. You'll need a Github account to start adding issues, but you can browse and search them without an account. Please feel free to add any legitimate non-framework-specific browser issues to the tracker &#8211; desktop browser issues are indeed helpful as well. If an issue deals with a browser in active development, please remember to file the issue with that browser's tracker as well (but please still file it at Device Bugs too). The <a href="http://movethewebforward.org/">Move the Web Forward</a> site gives more information on where popular browsers' trackers are found; some of which are not public, making a resource like Device Bugs all the more useful.</p>

<p>Lastly, the Device Bugs project contains an <a href="https://github.com/scottjehl/Device-Bugs/blob/master/ISSUE%20TEMPLATE">issue template</a> to make issue filing faster. If you don't want to use it, that's fine, but including any of the information suggested in the template would be very helpful to all.</p>

<p>Happy filing!</p>
					</div>
		
					
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>An Ajax&#45;Include Pattern for Modular Content</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/ajax_includes_modular_content/" />
      <id>tag:,2012:/lab/6.140</id>
      <published>2012-03-28T14:22:00Z</published>
      <updated>2012-04-06T10:41:14Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="ajax"
        scheme="http://filamentgroup.com/lab/tag/ajax/"
        label="ajax" />
      <category term="javascript"
        scheme="http://filamentgroup.com/lab/tag/javascript/"
        label="javascript" />
      <category term="jQuery"
        scheme="http://filamentgroup.com/lab/tag/jquery/"
        label="jQuery" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <category term="php"
        scheme="http://filamentgroup.com/lab/tag/php/"
        label="php" />
      <category term="progressive enhancement"
        scheme="http://filamentgroup.com/lab/tag/progressive_enhancement/"
        label="progressive enhancement" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Scott on 03/28/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/ajax/" rel="tag">ajax</a></dd><dd><a href="http://filamentgroup.com/lab/tag/javascript/" rel="tag">javascript</a></dd><dd><a href="http://filamentgroup.com/lab/tag/jquery/" rel="tag">jQuery</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd><dd><a href="http://filamentgroup.com/lab/tag/php/" rel="tag">php</a></dd><dd><a href="http://filamentgroup.com/lab/tag/progressive_enhancement/" rel="tag">progressive enhancement</a></dd>
				</dl>
						<p>While developing the front-end of the <a href="http://bostonglobe.com">BostonGlobe.com</a> site last fall, one of the toughest challenges we faced was delivering roughly the same content to all devices (and connection speeds) while ensuring the most important content on a page was usable as soon as possible. We approached this challenge with a variety of techniques, such as only loading the most essential JavaScript up-front (weighing roughly 4-6kb tops) and lazy loading the rest, dynamically injecting advertisements, and loading "nice-to-have" content via JavaScript&mdash;all after the initial content was delivered and usable. </p>
					</div>
		
					<h2>Bullet-proofing our Content Includes</h2>

<p>The idea of conditionally or lazy loading content is not a new one; indeed, <a href="http://adactio.com/articles/5043/">Jeremy Keith covered a similar pattern last year</a>, and many sites already employ similar techniques. These techniques help a great deal when optimizing a page, but&mdash;particularly when dealing with conditionally loading HTML content&mdash;we need to be careful to use them in ways that do not introduce barriers to universal accessibility.</p>

<p>In order to lazy load nonessential content on BostonGlobe.com without introducing access barriers, we developed a simple, markup-driven &#8220;Ajax-include&#8221; pattern that enhanced certain links on a page by including a fragment of content from a URL related to their linked resource. For example, the header of BostonGlobe.com contained a link to the Weather section of the website, and that same link is also used as a marker for including a fragment of content from that section that is used to create a weather widget.</p>

<h3>Initial State:</h3>
<div><img src="http://filamentgroup.com/images/bglobe-weather-initial.png" style="max-width:100%" alt="initial Boston Globe weather widget"></div>

<h3>Expanded, Ajax-enhanced state:</h3>
<p><img src="http://filamentgroup.com/images/bglobe-weather-full.png" style="max-width:100%" alt="expanded Boston Globe weather widget"></p>

<p>With this pattern in place, we found a nice balance between loading performance and accessibility: the content begins lightweight, and accessible without Javascript, and it is enhanced into a richer experience on capable devices&mdash;all without holding up the initial page load.</p>

<p>From a technical standpoint, the approach was simple: any element in the page could reference an external HTML fragment by URL through a small set of predefined HTML5 <code>data-</code> attributes; our JavaScript would simply loop through those elements, Ajax-request their referenced content, and inject it into the page (either before, after, or in place of the referencing element, depending on which <code>data-</code> attribute was in play). </p>

<p>Pseudo-markup for the particular scenario above, which the JS would enhance by including the referenced fragment:</p>
<pre><code>&lt;a href=&rdquo;fullpage.html&rdquo; data-include=&rdquo;fullpage-fragment.html&rdquo;&gt;Full Page&lt;/a&gt;</code></pre>

<p>The technique worked well, and we began using it in several places to lighten the Globe&#8217;s initial load. Around that time, we also tweeted a <a href="https://gist.github.com/983328">gist snippet</a> of the technique as it stood (crediting <a href="http://scottgonzalez.com/">Scott Gonzales</a> for some of the initial thinking behind the idea).</p>

<h2>A tipping point</h2>

<p>Unfortunately, as we began to use this technique more within our templates, its effectiveness began to decrease: each Ajax-include incurred a separate HTTP request, and with more than a few includes on a page at a time, those requests often clogged the time it took for a basic experience to become enhanced. On many mobile devices, this problem could quickly become serious: you only need to read a couple Steve Souders posts to know that the number of concurrent requests allowed by devices can be quite low. With varying connection speeds, it often resulted in our "nice-to-have" content taking too long to arrive. </p>

<p>This limitation meant restricting our usage to a few particularly worthwhile components per page, and continuing to strive to keep the total page weight as low as possible. (Which is, of course, a good plan in any case). Still, we wondered if the concept could be extended somehow without the drawbacks.</p>

<h2>Getting-by with a little help</h2>

<p>Skip forward a few months to yesterday: <a href="http://nicolasgallagher.com">Nicolas Gallagher</a> and I were <a href="https://twitter.com/#!/scottjehl/status/184635150792003584">chatting on Twitter about dynamic content inclusion</a>, particularly the non-essential parts:</p>

<blockquote class="twitter-tweet" data-in-reply-to="184630372942884864"><p>@<a href="https://twitter.com/necolas">necolas</a> agreed. In those situations, I like the idea of something like an anchor-include pattern for nice-to-haves. <a href="https://t.co/LbJC7R1f" title="https://gist.github.com/983328">gist.github.com/983328</a></p>&mdash; Scott Jehl (@scottjehl) <a href="https://twitter.com/scottjehl/status/184635150792003584" data-datetime="2012-03-27T13:37:04+00:00">March 27, 2012</a></blockquote>
<blockquote class="twitter-tweet" data-in-reply-to="184647008500449282"><p>@<a href="https://twitter.com/necolas">necolas</a> Thanks! working on a pattern to bring those under 1 lazy request right now&#8230;</p>&mdash; Scott Jehl (@scottjehl) <a href="https://twitter.com/scottjehl/status/184652139514167296" data-datetime="2012-03-27T14:44:35+00:00">March 27, 2012</a></blockquote>
<script src="//platform.twitter.com/widgets.js" charset="utf-8"></script>



<p>After a bit of hacking, it appeared that our existing Ajax-include approach could be extended to handle all content includes via a single HTTP request. Not long after that, a <a href="https://github.com/filamentgroup/Ajax-Include-Pattern/">Gitub repo</a> was pushed, which offers the code for you to use anywhere you&#8217;d like, and perhaps help us improve too (if you please).</p>

<h2>A Quick Demo</h2>

<p>The page linked below contains with 3 links to hypothetical, non-essential content. <code>Data-after</code> attributes in the page reference content by URL as well, which is pulled in dynamically and automatically with Ajax. If you use a browser inspector tool, you&#8217;ll notice that the 3 Ajax-include&#8217;d sections of the page arrive via one request.</p>

<p><strong>Demo page:</strong> <a href="http://filamentgroup.com/examples/ajax-include/demo.html">http://filamentgroup.com/examples/ajax-include/demo.html</a></p>

<p><strong>Github code repo</strong> <a href="https://github.com/filamentgroup/Ajax-Include-Pattern/">https://github.com/filamentgroup/Ajax-Include-Pattern/</a></p>


<h2>How it works</h2>

<p>The difference between the initial approach and this single-request version is not major: instead of requesting each piece of content via separate HTTP requests, the JavaScript makes a single request to a server-side helper script (included in the code repo), telling it which pieces of content to pack into a single response back to the UI. </p>

<p>Technically, all this means is a PHP-or-otherwise script is configured to accept a query string of comma-separated URLs and spit out the contents of those files in a single response. To identify the separate pieces of content within the response, the PHP proxy wraps each one in an invented <code>&lt;entry&gt;</code> element with a <code>url</code> attribute referencing the location from which it was fetched (<strong>note:</strong> this was formerly a <code>&lt;page&gt;</code> element, but now that our demo is using <a href="https://github.com/filamentgroup/quickconcat">quickconcat</a>, it's using <code>&lt;entry&gt;</code>. As such, the JS is now updated to look for <code>&lt;entry&gt;</code> element elements.). When this response arrives back to the UI, the JavaScript notifies all of the Ajax-include elements on the page, and the proper subset of content for each element is injected into that element's location in the page.</p>

<p>The proxy, by the way, is optional; without it, the script will revert to multiple requests. Depending on the use case, this might be preferable as well. For more information on the proxy that we're using in the demo (and that is included in the code repo) check out the <a href="https://github.com/filamentgroup/quickconcat">quickconcat project on Github</a>.</p>

<p>As far as dependencies go, the current script uses jQuery, but it could probably be done pretty concisely without it (though the event handling might make for some fun workarounds). It could also easily be built without PHP. We would love to see a pull request or two with alternatives!</p>


<h2>Using the code</h2>
<p>To use the technique yourself, grab the code from the Github repo above and...</p>
<style>
ol,li{list-style: decimal; padding-left: 0;}
ol pre { font-size: 12px; }
</style>
<ol >
<li>Include jquery.js and jquery.ajaxinclude.js in your page (anywhere&#8217;s fine)</li>
<li>Add attributes to elements in your page where nonessential fragments of content can be included from an external URL, using jQuery-api-like qualifiers like <code>data-after</code>, <code>data-before</code>, and <code>data-replace</code>:
<pre><code>
&lt;h2 data-after=&quot;/related-articles/45?fragment&quot;&gt;&lt;a href=&quot;/related-articles/45&quot;&gt;Related Articles&lt;/a&gt;&lt;/h2&gt;
</code></pre>
</li>
<li>When the DOM is ready, select the Ajax-include elements on the page and call the ajaxInclude method on them, passing the URL of the server-side proxy and expected query string:
<pre><code>
$( "[data-after]" ).ajaxInclude( "quickconcat.php?wrap&files=" );
</code></pre>
</li>
</ol>


<p><strong>Note:</strong> an ideal use case might have an anchor link somewhere in the page referencing a full HTML document, and a data-attribute somewhere else in the page referencing a smaller HTML fragment to include into the page (pseudo-coded above with the ?fragment in the URL). You might also employ smarter server logic to simply return the fragment when the page is requested via Ajax instead of regular HTTP, but let&#8217;s not get ahead of ourselves...</p>

<p>For more information on using the code, check out the <a href="https://github.com/filamentgroup/Ajax-Include-Pattern/#readme">project readme</a>.</p>

<h2>Taking this pattern further</h2>

<p>The idea of a building websites in a more modular, container-independent manner is a hot topic, and for good reason: every day we&#8217;re dealing with more diversity across the devices that access our sites, and we want to deliver the best experience we can to all. </p>

<p>With the downsides of this pattern tamed, perhaps we could even start to consider ways to extend our notion of what&#8217;s essential in a webpage...</p>

<p>Perhaps a news article&#8217;s initial HTML delivery consists of nothing but the article itself and some links to the top-level sections of the website, while the rest of the page is deferred to Ajax-includes... or maybe a landing page consists of nothing but links to the top-level sections of a website, and then the rest of the content (headlines, article teases, etc) is included via ajax in a separate request.</p>

<p>In both of these examples, the page would deliver light-weight and lightning fast, allowing you to prioritize the truly essential bits that should be there at the start, and let the slow stuff come in moments after.</p>

<p>You might even take it farther to apply a DRY-like pattern across all pages on a site or application, where each piece of content truly has only one home, and pages can borrow freely from the content of others to create mashup pages that resemble the sorts of pages we use today. (And perhaps a slightly smarter server-side helper could find the fragments within a page by their identifiers to facilitate this....)</p>

<p>A related sketch from my notes during last year&#8217;s Mobilewood meetup (click image for full size):</p>

<p><a href="http://filamentgroup.com/images/modular-page.png"><img src="http://filamentgroup.com/images/modular-page.png" style="max-width:100%" alt="a concept diagram of a modular webpage"></a></p>


<h2>Thoughts? Ideas?</h2>

<p>Whether you do or don&#8217;t use this particular script, we&#8217;d love to hear what you think of the pattern. We&#8217;re pretty excited by the potential optimizations that could come out of it, so please drop us a note, or even fork the code and extend it further!</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>A Responsive Design Approach for Navigation, Part 1</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/responsive_design_approach_for_navigation/" />
      <id>tag:,2012:/lab/6.135</id>
      <published>2012-02-27T19:32:00Z</published>
      <updated>2012-03-27T15:20:57Z</updated>
      <author>
            <name>Maggie</name>
                  </author>

      <category term="progressive enhancement"
        scheme="http://filamentgroup.com/lab/tag/progressive_enhancement/"
        label="progressive enhancement" />
      <category term="responsive design"
        scheme="http://filamentgroup.com/lab/tag/responsive_design/"
        label="responsive design" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Maggie on 02/27/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/progressive_enhancement/" rel="tag">progressive enhancement</a></dd><dd><a href="http://filamentgroup.com/lab/tag/responsive_design/" rel="tag">responsive design</a></dd>
				</dl>
						<p>As we create responsive websites, we must consider a number of factors to make sure both the design and code are as bullet-proof as possible: the design must scale across a wide range of screen sizes from mobile to tablet to desktop; and the code must start with a mobile-first approach, work well for screen readers or with JavaScript disabled, and be robust enough to adapt to differences in text size and rendering across devices or user settings.</p>  

<p>Adapting site navigation to be understandable, usable and attractive across a wide range of devices is particularly challenging. On the <a href="http://bostonglobe.com/">Boston Globe site</a>, we gained some key insights about how to build robust mobile-first responsive navigation systems. This is the first in a series of articles in which we'll explore navigation design techniques from very simple nav bar design, to complex multi-level hierarchies, search, and fuller featured navigation systems.</p>
					</div>
		
					<h2>Truly responsive navigation</h2>

<p>Using progressive enhancement, CSS media queries, and a little JavaScript, we built a navigation list that adjusts to fit the size of the screen and adapts to differences in text sizing. <a href="/examples/rwd-nav-patterns/"><strong>View the demo</strong></a></p>

<p>We're in the process of rethinking our site design, so we used our own navigation list as a test case.  It consists of 5 options &#8212; What We Do, What We've Done, What We're Thinking, Who We Are, and Contact Us.  These  options can take up a lot of space on a tiny mobile screen, so our goal was simple: for smaller screens we'll make the navigation as compact as possible to save room for the main content, and on larger screens with ample space we'll display all options in a horizontal bar for quicker access.</p>

<p>We marked up a standard unordered list of links, usable on any device that renders HTML, layered on a few mobile-friendly styles to make the hit area bigger for finger taps, and then added a little JavaScript to transform the list into a custom dropdown menu.  Users that don't have JavaScript enabled will just see the full list &#8212; no harm, no foul.</p>

<p>For larger screens, we used CSS3 media queries to display the options in a horizontal bar.  We wanted to ensure that the screen has enough room to display the entire bar in a single line (we don't want the nav or its options to wrap because, in this case, wrapping would make the page look broken or mess with the navigation hierarchy), so we estimated the minimum width value: width of the horizontal navigation bar + the width of any neighboring elements + a little wiggle room.  We tested this breakpoint across a wide range of browsers, and increased the value when we saw options wrap.</p>

<p>We could've stopped there, but we can't forget that screen size is just one of many factors that effect how a layout is displayed.  Take text rendering, for example:  the type, size, and shape of fonts can vary among operating systems/browsers, and users have the option to adjust sizing with browser controls.  (And, as Stephanie Rieger notes, the list of user-controlled variables <a href="http://stephanierieger.com/the-trouble-with-ice-cream-sandwich/">is growing</a>.)  So, while it makes sense to use media queries as a baseline for altering the layout, we made our navigation bar feel smarter and more responsive with a little JavaScript to detect whether the horizontal nav bar fits in the available space, regardless of screen size; when the fit test fails, the navigation remains a custom dropdown menu.</p>

<p>The final result is a navigation list that's optimized for use on a wide range of screen widths and with variable text sizes.  We'll walk through this example in detail below.</p>


<h2>Markup</h2>

<p>The menu is a list of links, so that's what we'll use: a standard unordered list with anchor tags.  We'll group the list with a heading to identify the navigation element, "Sections", and give the outer container a descriptive class for scoping styles, <code>nav-primary</code>.</p>

<pre><code>&lt;div class=&quot;nav-primary&quot;&gt;
   &lt;h3&gt;Sections:&lt;/h3&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/services&quot;&gt;What We Do&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/portfolio&quot;&gt;What We've Done&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/lab&quot;&gt;What We're Thinking&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/about&quot;&gt;Who We Are&lt;/a&gt;&lt;/li&gt;		
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/contact&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>We'll assign the class <code>nav-current</code> to the active navigation option; this will come in handy later when we create the custom dropdown menu.</p>

<pre><code>&lt;li <strong>class=&quot;nav-current&quot;</strong>&gt;&lt;a href=&quot;http://www.filamentgroup.com/services&quot;&gt;What We Do&lt;/a&gt;&lt;/li&gt;</code></pre>

<p>To round out our example, we'll add the Filament Group logo and a small block of content. For screen readers we'll provide a "skip navigation" link so that they don't have to navigate through the list on every page.</p>

<pre><code>&lt;a href=&quot;http://www.filamentgroup.com/&quot; id=&quot;logo&quot;&gt;&lt;img src=&quot;fg-logo.gif&quot; alt=&quot;Filament Group, Inc.&quot; /&gt;&lt;/a&gt;

&lt;a href=&quot;#main&quot; class=&quot;skip&quot;&gt;Skip navigation&lt;/a&gt;

&lt;div class=&quot;nav-primary&quot;&gt;
   &lt;h3&gt;Sections:&lt;/h3&gt;
	&lt;ul&gt;
		&lt;li class=&quot;nav-current&quot;&gt;&lt;a href=&quot;http://www.filamentgroup.com/services&quot;&gt;What We Do&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/portfolio&quot;&gt;What We've Done&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/lab&quot;&gt;What We're Thinking&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/about&quot;&gt;Who We Are&lt;/a&gt;&lt;/li&gt;		
		&lt;li&gt;&lt;a href=&quot;http://www.filamentgroup.com/contact&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;

&lt;div class=&quot;content&quot;&gt;
   &lt;p&gt;We offer services from strategy to UI and application design, to accessible front-end code development, and happily work with clients to find the right mix that supports their internal capabilities.&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>Before we wrap up the markup, we want to make sure that our page content is sized to fit the screen, so we'll add a viewport <code>meta</code> tag (<a href="https://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html">how the viewport <code>meta</code> tag works</a>):</p>

<pre><code>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;</code></pre>

<p>We now have a legible, usable page to which we can add style and behavior enhancements.</p>

<p><img src="/examples/rwd-nav-patterns/screens/markup.png" alt="Basic markup rendered on a mid-sized screen" /></p>


<h2>Styles for the small screen</h2>

<p class="note">If you're not familiar with using CSS3 media queries to render pages responsively, we highly recommend Ethan Marcotte's definitive article, <a href="http://www.alistapart.com/articles/responsive-web-design/">Responsive Web Design</a>, and <a href="http://www.abookapart.com/products/responsive-web-design">book by the same title</a>.</p>

<p>We'll start with a few basic styles that make the links easier to read and tap on small screens (a block display property and padding, and a font-size that's large enough for finger-based gestures), and a few additional styles to make the list easier to scan (borders between options, and bold text for the active option).  We'll also hide the "Sections" heading (h3), but in a way that keeps it accessible to screen readers.</p>

<pre><code>.nav-primary h3 {
   position: absolute;
   left: -999em;
}
.nav-primary ul {
   border: 1px solid #e6e6e6;
}
.nav-primary li {
   font-size: 1.8em;
   border-bottom: 1px solid #eee;
}
.nav-primary li:last-child {
   border-bottom: 0;
}
.nav-primary a {
   display: block;
   padding: .5em .8em;
   text-decoration: none;
   color: #333;
}
.nav-primary a:hover {
   background-color: #f8f8f8;
}
.nav-primary .nav-current {
   font-weight: bold;
}
</code></pre>

<p>We'll add a few more rules to style the overall page, logo and content blocks, and another rule to make the navigation play nicely with them (clear the logo, and add space before the content). We want the "skip" link to be available to screen readers but hidden from everyone else, so we'll position it off the page.</p>

<pre><code>body {
    font: 62.5%/1.4 helvetica, arial, sans-serif; 
    padding: 2em 1em;
}
#logo {
   float: left;
   margin: 0 0 1em; 
}
.content {
   clear: both;
}
p {
   font-size: 1.8em;
   line-height: 1.4;
   margin: 0 .3em 1em;
}
a.skip {
   position: absolute;
   left: -999em;
}

...

.nav-primary {
   clear: left;
   margin: 0 0 2em;
}
</code></pre>

<p><img src="/examples/rwd-nav-patterns/screens/small-basicCSS.png" alt="Basic styles rendered on a small screen" /></p>

<h2>...and for larger screens, like tablets and desktops</h2>

<p>Our page looks nice at smaller screen widths, but on a larger screen, each option stretches to fill the space and the navigation dominates the page.</p>

<p><img src="/examples/rwd-nav-patterns/screens/med-basicCSS.png" alt="Basic styles rendered on a larger screen; the navigation takes up too much space" /></p>

<p>To fix this, we'll add a couple of rules, scoped within a media query, to display the navigation as a horizontal bar in screens that are 640px wide and larger (640 = full width of the navigation + body padding).</p>

<p>We'll float each navigation option to the left, remove the border between options, and assign a slightly smaller font size.  We'll also float the navigation block itself and the list container so that they fully contain their floated child elements.</p>

<pre><code>@media screen and (min-width: 640px) {
   .nav-primary,
   .nav-primary ul {
      float: left;
   }
   .nav-primary ul {
      float: left;
   }
   .nav-primary li {
      float: left;
      font-size: 1.5em;
      border-bottom: 0;
   }   
}</code></pre>

<p>Much better.</p>

<p><img src="/examples/rwd-nav-patterns/screens/med-mediaquery.png" alt="Navigation rendered as a horizontal bar on screens 640px or wider" /></p>

<p>When the screen is wide enough to fit the logo and nav side-by-side &#8212; 910px, specifically &#8212; we'll float the navigation block to the right.  We arrived at that number by adding the width of the logo (250px) to the width of the navigation list displayed horizontally (640px), plus a little extra margin to account for slight browser rendering differences (20px).</p>

<pre><code>@media screen and (min-width: 910px) {
   .nav-primary {
      float: right;
      clear: none;
   }   
}</code></pre>

<p>Our navigation now assumes one of two forms in response to the screen's size:  a list on smaller screens, or a horizontal bar on larger screens.</p>

<p><img src="/examples/rwd-nav-patterns/screens/mediaquery.png"  alt="Examples showing a list on smaller screens, or a horizontal bar on larger screens" /></p>

<p>As it stands, our navigation looks pretty good on a range of screen sizes &#8212; but there is definitely room for improvement.  On small screens, our navigation list still takes up a good chunk of vertical space, and on larger screens, our horizontal navigation bar wraps when we increase our browser's text size.  Bump up the text a couple of times on a tablet-sized screen and the options wrap to a second line:</p>

<p><img src="/examples/rwd-nav-patterns/screens/text2-options-wrap.png"  alt="Navigation options wrap to a second line when text size is increased" /></p>

<p>And at larger sizes, the entire navigation bar wraps under the logo, creating odd gaps of white space:</p>

<p><img src="/examples/rwd-nav-patterns/screens/text2-nav-wraps.png"  alt="Navigation bar wraps under the logo when text size is increased" /></p>

<p>So we have two issues left to address:</p>

<ul>
<li>transform the navigation into a compact, custom dropdown menu when screen space is limited, and</li>
<li>create a test to determine if navigation options will fit on a single line, or if the entire bar will fit next to the logo on larger screens; if not, show the compact menu.</li>
</ul>

<p>We'll start with menu styles, and then fill in the test logic.</p>

<h2>Styles for a compact menu</h2>

<p>We'll write styles to hide all options by default except for the active option, <code>nav-current</code>, and display the "Sections" heading as a clickable dropdown button positioned to the right.  We'll add another class, <code>expanded</code>, that we'll toggle with JavaScript to show/hide the full list of options.</p>

<p>Note that these styles are all scoped to the class, <code>nav-menu</code>.  Later, our test logic will toggle this class on the <code>body</code> tag.</p>

<pre><code>.nav-menu .nav-primary {
   margin: 0 0 1.5em;
   position: relative;
   overflow: hidden;
}
.nav-menu .nav-primary a {
   padding-right: 3em;
}
.nav-menu .nav-primary h3 {
   position: absolute;
   top: 0;
   left: auto;
   right: 0;
   display: block;
   width: 4em;
   height: 4.5em; 
   background: #ccc url(img/icons.png) no-repeat -205px 45%;
   text-indent: -999em;
   cursor: pointer;
}
.nav-menu .nav-primary.expanded h3 {
   background-position: -169px 45%;
}
.nav-menu .nav-primary li {
   clear: left;
   display: none;
}    
.nav-menu .nav-primary.expanded li,
.nav-menu .nav-primary li.nav-current {
   display: list-item;
} 
.nav-menu .nav-primary li.nav-current {
   border-bottom-width: 0;
}
.nav-menu .nav-primary.expanded li.nav-current {
   border-bottom-width: 1px;
}</code></pre>

<p>Now, when JavaScript is enabled, the menu will take a more compact form:</p>

<p><img src="/examples/rwd-nav-patterns/screens/small-menu.png"  alt="Navigation rendered as a compact menu" /></p>

<p>Next, we'll write a bit of JavaScript to ensure that our navigation bar fits the available space.

<h2>Does the navigation fit?</h2>

<p>We'll bind a custom event, "testfit", to the navigation container.  We'll trigger this event when the page loads, and when the screen changes size or orientation.  (A nice side effect: desktop browsers that support text zooming, like the latest versions of Chrome, Firefox, and Opera, trigger the <code>resize</code> event &#8212; and this test &#8212; when the user increases or decreases text sizing with browser controls or key commands.)</p>

<pre><code>$('.nav-primary')
   // test the menu to see if all items fit horizontally
   .bind('testfit', function(){
      // ...logic goes here...
   }) 
   
   // ...and update the nav on window events
   $(window).bind('load resize orientationchange', function(){   
      $('.nav-primary').trigger('testfit');
   });</code></pre>

<p>When the test passes, we'll add the <code>nav-menu</code> class to the <code>body</code>. One of the following conditions must be met for "testfit" to pass: when the entire nav wraps to a second line under the logo, or when any of the navigation options wrap to a second line.  In both cases, we test for wrapping by comparing top offset values, which can be effected by changes in screen or text size.  When the navigation's top value is greater than the logo's, the navigation has wrapped to the next line; when the last navigation option's top value is greater than the first, it's wrapped. </p>

<p>We'll also remove the <code>nav-menu</code> class from the <code>body</code> to reset the styles before the test is run.</p>

<pre><code>$('.nav-primary')
   // test the menu to see if all items fit horizontally
   .bind('testfit', function(){
      var nav = $(this),
            items = nav.find('a');
      
      $('body').removeClass('nav-menu');                                
      
      // when the nav wraps under the logo, or when options are stacked, display the nav as a menu              
      if ( (nav.offset().top > nav.prev().offset().top) || ($(items[items.length-1]).offset().top > $(items[0]).offset().top) ) {
      
         // show the menu -- add a class for scoping menu styles
         $('body').addClass('nav-menu');
      
      };           
   })
      
   ...</code></pre>

<p>Finally, we'll assign a click event to the heading element to show/hide the menu options.</p>

<pre><code>$('.nav-primary').find('h3')
   .bind('click focus', function(){
      $(this).parent().toggleClass('expanded')
   });</code></pre>

<p>We now have a menu that is responsive to differences in screen size (<a href="/examples/rwd-nav-patterns/">view the demo</a>):</p>

<p><a href="/examples/rwd-nav-patterns/"><img src="/examples/rwd-nav-patterns/screens/menus.png" alt="Examples of the closed menu and with all options visible, sized for the tablet screen, and displayed as a horizontal bar next to the logo" /></a></p>

<p>..and text size:</p>

<p><a href="/examples/rwd-nav-patterns/"><img src="/examples/rwd-nav-patterns/screens/text-zoom.png"  alt="On larger screens, the navigation becomes a compact menu when text size is increased and the nav no longer fits on one line" /></a></p>

<h2>Keep the conversation going</h2>

<p>The pattern discussed here is one possibility for coding a responsive navigation list. We hope to discover more, and will update our <a href="https://github.com/filamentgroup/RWD-Nav-Patterns">RWD-Nav-Patterns git repository</a> as we build additional examples.</p>

<p>This demo code is open source and available for download. Feel free to put it through its paces. If you use it and see room for improvement, please submit a pull request and we'll review it as soon as possible.</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>W3C Launches Responsive Images Community</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/w3c_responsive_imgs_group/" />
      <id>tag:,2012:/lab/6.137</id>
      <published>2012-02-24T09:20:00Z</published>
      <updated>2012-02-24T17:24:01Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="announcements"
        scheme="http://filamentgroup.com/lab/tag/announcements/"
        label="announcements" />
      <category term="responsive design"
        scheme="http://filamentgroup.com/lab/tag/responsive_design/"
        label="responsive design" />
      <category term="web standards"
        scheme="http://filamentgroup.com/lab/tag/web_standards/"
        label="web standards" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Filament Group on 02/24/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/announcements/" rel="tag">announcements</a></dd><dd><a href="http://filamentgroup.com/lab/tag/responsive_design/" rel="tag">responsive design</a></dd><dd><a href="http://filamentgroup.com/lab/tag/web_standards/" rel="tag">web standards</a></dd>
				</dl>
						<p>Responsible image asset loading has long been a problem in cross-device development, and more recently, in responsive design. While developing the new BostonGlobe.com, we released <a href="http://filamentgroup.com/lab/responsive_images_experimenting_with_context_aware_image_sizing/">an approach to the problem</a> that worked well at the time, but unfortunately proved less optimal as newer browsers' image prefetch "improvements" effectively broke it. Around that time, <a href="http://www.cloudfour.com/responsive-imgs/">consensus gathered</a> that device-detection-based approaches were most viable until we get better tools, and at that point we tended to agree.</p>

<p> Shift ahead a few months, when our own Mat Marquis penned the A List Apart article, <a href="http://alistapart.com/articles/responsive-images-how-they-almost-worked-and-what-we-need/">Responsive Images: How they Almost Worked and What We Need</a> providing great background on today's workarounds, and a rough proposal for a markup-based approach moving forward. Hot on the heels of that article, the W3C has formed a <a href="http://www.w3.org/community/respimg/">Responsive Images Community Group</a>, of which Mat is the chair, to continue guiding this idea through to potential standardization.</p>

<p>Filament Group is thrilled to see this idea begin to take shape, and we're doing all we can to help (<em>Scott here even <a href="http://www.w3.org/community/respimg/2012/02/21/a-sample-picture-implementation/">released a functional picture element polyfill</a> to aid in the planning</em>). If you're at all interested in the direction of this feature, feel free to follow, or join, the <strong><a href="http://www.w3.org/community/respimg/">W3C Responsive Images Group</a></strong>. We'll hope to see you there!</p>

					</div>
		
					
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Overthrow: An overflow polyfill for responsive design</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/overthrow/" />
      <id>tag:,2012:/lab/6.136</id>
      <published>2012-02-22T03:00:00Z</published>
      <updated>2012-02-22T14:46:18Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="accessibility"
        scheme="http://filamentgroup.com/lab/tag/accessibility/"
        label="accessibility" />
      <category term="css"
        scheme="http://filamentgroup.com/lab/tag/css/"
        label="css" />
      <category term="javascript"
        scheme="http://filamentgroup.com/lab/tag/javascript/"
        label="javascript" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <category term="responsive design"
        scheme="http://filamentgroup.com/lab/tag/responsive_design/"
        label="responsive design" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Scott on 02/21/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/accessibility/" rel="tag">accessibility</a></dd><dd><a href="http://filamentgroup.com/lab/tag/css/" rel="tag">css</a></dd><dd><a href="http://filamentgroup.com/lab/tag/javascript/" rel="tag">javascript</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd><dd><a href="http://filamentgroup.com/lab/tag/responsive_design/" rel="tag">responsive design</a></dd>
				</dl>
						<p>We&#8217;ve come to take the CSS <code>overflow</code> property for granted when designing websites for desktop browsers. Scrolling regions offer a powerful tool in UI design that we would love to have at our disposal on mobile devices &#8212;especially when building app interfaces.  </p>

<p>But overflow support among mobile devices is spotty: some browsers support it, but many popular ones at best require 2-finger gestures to scroll the content, and at worst treat the content the same as <code>overflow: hidden</code>, making it inaccessible to users. Newer mobile browsers are making fantastic progress, but when we look across the full landscape, we see many gaps.  </p>

<p>So we set out to build a solution that smoothes the way. <a href="http://filamentgroup.github.com/Overthrow/">Overthrow.js</a> is a conservative attempt at filling the gaps in overflow support, with an emphasis on letting native implementations do their thing, and ensuring a usable experience in all browsers. </p>
					</div>
		
					<p><a href="http://filamentgroup.github.com/Overthrow/" class="book-site">Overthrow Project Site</a></p>

<h2 id="for_cross_device_overflow_no_perfect_solutions">For cross-device overflow, no perfect solutions</h2>

<div class="callout_text"><img src="/images/overthrow-comic.png" alt="illustration of a mobile device with a scrolling region"></div>

<p>Overflow support is gaining rapidly in newer versions of mobile browsers.  For example,  iOS5&#8217;s Mobile Safari, the new Chrome for Android, BlackBerry 7+, PlayBook, Android 3+, Firefox Mobile, and WebOS 3 (including) TouchPad, all support the native CSS <code>overflow</code> property.  This is terrific news, in theory&#8230;  But, with the exception of IOS5 and Chrome &#8211; which offer a secondary CSS property (momentum scrolling via <code>-webkit-overflow-scrolling: touch</code>) we can use to test and determine that overflow is supported &#8211; it&#8217;s virtually impossible to detect proper support for overflow.  And unfortunately, a significant number of very popular mobile devices run earlier browser versions that don&#8217;t support overflow partially or improperly, and will abjectly fail. </p>

<p>This leaves us with a dilemma. Scrolling regions provide great benefits when they work, but unqualified use of them can lead to major accessibility problems. When building with a responsive design approach,  we want to deliver a single solution that will serve a variety of devices from handheld to desktop, and we need to know reliably that the tools we use will either work or fail gracefully. With the lack of a definitive test on so many devices and platforms, we were hesitant to use overflow at all. But with the potential benefits, and with so many new devices adding support, it seems important to try to somehow make overflow work.</p>

<p>First, we looked to a number of popular open-source projects that bring overflow support to touch devices to see whether any would satisfy our requirements.  Specifically, we were searching for an approach that:</p>

<ul>
<li>Applies overflow as a qualified progressive enhancement, only applying it in devices that we can trust to get it right,</li>
<li>Simulates overflow support in popular browsers that do not support overflow natively, but are capable of reasonably handling it with JavaScript,</li>
<li>Is lightweight, framework-independent, and can be delivered to any browser without introducing lots of unnecessary overhead,</li>
<li>Uses native scroll properties like scrollTop, to play nicely with native browser behavior such as deep-linking to document fragments,</li>
<li>Requires no additional markup containers and simulates scroll without introducing unexpected positioning contexts, rendering issues, or problems with form control accessibility,</li>
<li>Provides an accessible experience to every browser.</li>
</ul>

<p>Most importantly, we wanted an approach that is designed to slowly kill itself off, allowing native implementations to do their thing as support becomes better and better.</p>

<p>In reviewing the existing solutions, we determined that none we could find satisfied all the above criteria. So we set out to build one that does.</p>

<h2 id="introducing_overthrow_a_solution_to_bridge_the_gaps">Introducing Overthrow, a solution to bridge the gaps</h2>

<p><a href="http://filamentgroup.github.com/Overthrow/">Overthrow</a> is a conservative attempt at addressing inconsistent overflow support, and ensuring a usable experience in all browsers.  </p>

<p>Simply put, Overthrow provides a means to take advantage of native overflow in browsers we know can support it, deliver simple content that&#8217;s left uncropped and fully accessible in cases where we know overflow will not work, and delivers a polyfill solution to provide a little &#8216;help&#8217; to a subset of mobile browsers that need it. </p>



<h3 id="basic_use">Basic use</h3>

<p>First, download and reference overthrow.js from your document. Anywhere&#8217;s fine.</p>

<pre><code>&lt;script src="overthrow.js"&gt;&lt;/script&gt;
</code></pre>

<p>Then put a class of <code>overthrow</code> on any elements in which you&#8217;d like to apply <code>overflow: auto</code> or <code>scroll</code> CSS.</p>

<pre><code>&lt;div id="foo" class="overthrow"&gt;Content goes here!&lt;/div&gt;
</code></pre>

<p>In browsers that Overthrow deems capable of scrolling overflow content (<em>either natively, or using its touch polyfill</em>), it will add a class of <code>overthrow-enabled</code> to the <code>html</code> element. Add the following CSS to your stylesheet somewhere, enabling overflow on all elements in your document that have an <code>overthrow</code> class.</p>

<pre><code>/* Overthrow CSS:
   Enable overflow: auto on elements with overthrow class when html element has overthrow-enabled class too */
.overthrow-enabled .overthrow {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
</code></pre>

<p>That&#8217;s it. Design away! Any time you want to set dimensions on an element to use overflow scrolling, just be sure to key off that <code>overthrow</code> class on the HTML element, and <code>overflow: auto</code> will apply.</p>

<pre><code>.overthrow-enabled #foo {
    height: 280px;
}
</code></pre>

<p><a href="http://github.com/filamentgroup/Overthrow/">Overthrow is still in initial development</a> (version 0.1 at publishing time), but the results so far are quite promising. We&#8217;re looking to continue developing Overthrow in the open and would greatly appreciate help with testing and code improvements, particularly related to any issues in the <a href="http://github.com/filamentgroup/Overthrow/issues">tracker</a>.</p>

<p>Please check out the <a href="http://filamentgroup.github.com/Overthrow/">project website</a> for more information on Overthrow and how to use it in your projects. There are also a couple of quick &amp; dirty examples that demonstrate Overthrow in real-world layouts: <a href="http://filamentgroup.github.com/overthrow/examples/2-column">a Responsive Columned Layout</a> and a <a href="http://filamentgroup.github.com/Overthrow/examples/2-column">Responsive Dialog Layout</a>. </p>

<p>The code is <a href="http://github.com/filamentgroup/Overthrow/">hosted on Github</a>; if you&#8217;re able, please file bugs and suggest improvements in the <a href="http://github.com/filamentgroup/Overthrow/issues">issue tracker</a>.</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Filament Group&#8217;s Open Source Code Repositories</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/open_source_code_repositories/" />
      <id>tag:,2012:/lab/6.134</id>
      <published>2012-01-18T17:03:00Z</published>
      <updated>2012-01-25T18:40:00Z</updated>
      <author>
            <name>Maggie</name>
                  </author>

      <content type="html"><![CDATA[
       <p class="postData">Posted by Maggie on 01/18/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					
				</dl>
						<p>As enthusiastic supporters of standards, progressive enhancement, and responsive techniques, we frequently release open-source code. We're thrilled that so many of you find it useful, and are willing to help us make it better &#8212; thank you! </p>

<p>But keeping track of bugs and suggestions on this blog is difficult to manage, and frequently leads people to outdated code or examples. So we've decided to move all our open source projects to Git to make sharing, bug tracking and updates easier.</p>

<p>This page will serve as a centralized list of all projects, which we'll keep updated as we develop new widgets and techniques.  Look below for links to downloadable code, live demos, and articles explaining our thought process:</p>
					</div>
		
					<h3>Ajax-like file downloads 
<span class="demo-links">
<a href="https://github.com/filamentgroup/jQuery-File-Download">code</a>
</span>
</h3>
<p>A jQuery plugin to facilitate requests from the front end that result in a file &#8212; such as .doc or .xls &#8212; for download. The plugin does not actually use Ajax, but its syntax follows the conventions of jQuery's native Ajax functions, making it a natural addition to our jQuery toolset. <a href="/lab/jquery_plugin_for_requesting_ajax_like_file_downloads/">Read more...</a></p>

<h3>Collapsible content widget 
<span class="demo-links">
<a href="/examples/jquery-collapsible-content/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Collapsible-Content">code</a>
</span>
</h3>
<p>An accessible collapsible content panel plugin from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>. <a href="/lab/expand_and_collapse_content_accessibly_with_progressive_enhancement_jquery/">Read more...</a></p>

<h3>Custom input (checkbox, radiobutton) 
<span class="demo-links">
<a href="/dwpe/checkbox-radiobutton/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Custom-Input">code</a>
</span>
</h3>
<p>A jQuery plugin that uses progressive enhancement to transform a standard HTML checkbox or radio button into a visually customizable control, and leverages all of the accessibility features the native input provides (from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>).</p>

<h3>Custom file input 
<span class="demo-links">
<a href="/examples/jquery-custom-file-input/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Custom-File-Input">code</a>
</span>
</h3>
<p>A jQuery plugin that uses progressive enhancement to transform a standard HTML file input into a visually customizable control, and leverages all of the accessibility features the native input provides (from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>).  <a href="/lab/jquery_custom_file_input_book_designing_with_progressive_enhancement/">Read more...</a></p>

<h3>Date Range Picker
<span class="demo-links">
<a href="/examples/daterangepicker_v2/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-UI-Date-Range-Picker">code</a>
</span>
</h3>
<p>The jQuery UI date range picker modified to use the jQuery UI CSS framework so that it's ThemeRoller ready.  <a href="/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/">Read more...</a></p>

<h3>Drive-In
<span class="demo-links">
<a href="https://github.com/scottjehl/Drive-In">code</a>
</span>
</h3>
<p>A plugin and .htaccess file that you can drop onto your web server to sync multiple devices and simplify the QA/testing process.</p>

<h3>EnhanceJS 
<span class="demo-links">
<a href="https://github.com/filamentgroup/EnhanceJS">code</a>
</span>
</h3>
<p>A JavaScript framework designed specifically to deliver a usable experience to the widest possible audience, by testing the browser to determine whether it is capable of correctly supporting a range of essential CSS and JavaScript properties, and delivering features only to those that pass the test. <a href="/lab/introducing_enhancejs_smarter_safer_apply_progressive_enhancement/">Read more...</a></p>

<h3>Equalize heights 
<span class="demo-links">
<a href="/examples/equalHeights/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Equal-Heights">code</a>
</span>
</h3>
<p>A jQuery plugin to "equalize" the heights of boxes within the same container and create a tidy grid.  <a href="/lab/setting_equal_heights_with_jquery/">Read more...</a></p>

<h3>FlipPics
<span class="demo-links">
<a href="http://scottjehl.com/dconstruct/code/FlipPics-5-final/">demo</a> | 
<a href="https://github.com/scottjehl/FlipPics">code</a>
</span>
</h3>
<p>FlipPics is a demo site built as an example for a jQuery Mobile workshop. It is intended for educational / discussion purposes. The 5 folders represent a stepped process of applying progressive enhancement to build the application from basic HTML pages to a richer data-driven experience.</p>

<h3>Hide address bar
<span class="demo-links">
<a href="http://jsbin.com/edecew">demo</a> | 
<a href="https://github.com/scottjehl/Hide-Address-Bar">code</a>
</span>
</h3>
<p>In many devices, the address bar at the top can be manually hidden, and its absence frees up enough pixel room for a large, impactful heading, a critical piece of navigation, or even just a little more white space to air things out.  This approach hides the address bar in a browser-agnostic way, and was used for sites like <a href="http://bostonglobe.com/">BostonGlobe.com</a>, and the <a href="http://jquerymobile.com/">jQuery Mobile framework</a>. <a href="http://24ways.org/2011/raising-the-bar-on-mobile">Read the article at 24ways.org</a></p>

<h3>iOS orientation fix
<span class="demo-links">
<a href="http://scottjehl.github.com/iOS-Orientationchange-Fix/">demo</a> | 
<a href="https://github.com/scottjehl/iOS-Orientationchange-Fix">code</a>
</span>
</h3>
<p>A fix for the iOS bug that causes a user-zoomable page to scale beyond the width of the viewport when the device's orientation changes from portrait to landscape.  <a href="/lab/a_fix_for_the_ios_orientationchange_zoom_bug/">Read more...</a></p>

<h3>jQM Mail 
<span class="demo-links">
<a href="http://filamentgroup.github.com/jqm-mail/">demo</a> | 
<a href="https://github.com/filamentgroup/jqm-mail">code</a>
</span>
</h3>
<p>Experimental responsive web app layout using jQuery Mobile controls</p>

<h3>jQuery Mobile Pagination 
<span class="demo-links">
<a href="/examples/jqm-pagination/demo/">demo</a> | 
<a href="https://github.com/filamentgroup/jqm-pagination">code</a>
</span>
</h3>
<p>A jQuery Mobile plugin for sequential pagination between pages with support for touch, mouse, and keyboard. <a href="/lab/jquery_mobile_pagination_plugin/">Read more...</a></p>

<h3>Menu 
<span class="demo-links">
<a href="/examples/menus/flat.php">flat menu</a> <a href="/examples/menus/ipod.php">iPod-style</a> <a href="/examples/menus/flyout.php">flyout</a> | 
<a href="https://github.com/filamentgroup/jQuery-Menu">code</a>
</span>
</h3>
<p>A jQuery plugin which can be used to enhance a standard unordered list into a simple dropdown menu for a single list of options, a flyout menu for a smaller hierarchical list of options, and two variations on the iPod style, one with a back button and another with a linked breadcrumb to let users easily traverse back up the hierarchy. <a href="/lab/jquery_ipod_style_and_flyout_menus/">Read more...</a></p>

<h3>Pixel-to-em conversion 
<span class="demo-links">
<a href="/examples/pxToEm_v2/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Pixel-Em-Converter">code</a>
</span>
</h3>
<p>A jQuery plugin to quickly convert pixel values to ems (and vice versa) to support page scalability throughout a web site or application.  <a href="/lab/update_jquery_plugin_for_retaining_scalable_interfaces_with_pixel_to_em_con/">Read more...</a></p>

<h3>Preload images from CSS 
<span class="demo-links">
<a href="/examples/preloadImages/index_v5.php">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Preload-CSS-Images">code</a>
</span>
</h3>
<p>A jQuery plugin that automatically preloads all images referenced in CSS files.  <a href="/lab/update_automatically_preload_images_from_css_with_jquery/">Read more...</a></p>

<h3>Respond
<span class="demo-links">
<a href="http://scottjehl.github.com/Respond/test/test.html">demo</a> | 
<a href="https://github.com/scottjehl/Respond">code</a>
</span>
</h3>
<p>A fast and lightweight (3kb minified / 1kb gzipped) script to enable responsive web designs in browsers that don't support CSS3 Media Queries &#8212; in particular, Internet Explorer 8 and under, though it will probably patch support for other non-supporting browsers as well. <a href="https://github.com/scottjehl/Respond#readme">Read the project documentation on github</a></p>

<h3>Responsive images 
<span class="demo-links">
<a href="/examples/responsive-images/">demo</a> | 
<a href="https://github.com/filamentgroup/Responsive-Images">code</a>
</span>
</h3>
<p>This approach allows developers to start with mobile-optimized images in their HTML and specify a larger size to be used for users with larger screen resolutions &#8212; without requesting both image sizes, and without UA sniffing.  <a href="/lab/responsive_images_experimenting_with_context_aware_image_sizing/">Read more...</a></p>

<h3>Responsive navigation patterns 
<span class="demo-links">
<a href="/examples/rwd-nav-patterns/">demo</a> | 
<a href="https://github.com/filamentgroup/RWD-Nav-Patterns">code</a>
</span>
</h3>
<p>Experimental navigation structure and behavior patterns based on progressive enhancement and responsive web design.</p>

<h3>Responsive table patterns 
<span class="demo-links">
<a href="/examples/rwd-table-patterns/">demo</a> | 
<a href="https://github.com/filamentgroup/RWD-Table-Patterns">code</a>
</span>
</h3>
<p>An experimental approach to rendering a complex table, using progressive enhancement and responsive design methods, that displays comfortably at a wide range of screen sizes, provides quick access to the data, and preserves the table structure so that data can still be compared across columns. <a href="/lab/responsive_design_approach_for_complex_multicolumn_data_tables/">Read more...</a></p>

<h3>Slider 
<span class="demo-links">
<a href="/dwpe/slider/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Slider">code</a>
</span>
</h3>
<p>A jQuery plugin that uses progressive enhancement to transform a standard HTML input or select element into a slider, and leverages all of the accessibility features the native element provides (from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>).</p>

<h3>Tabs 
<span class="demo-links">
<a href="http://filamentgroup.github.com/Accessible-jQuery-Tabs/demo-default.html">demo</a> | 
<a href="https://github.com/filamentgroup/Accessible-jQuery-Tabs">code</a>
</span>
</h3>
<p>An accessible jQuery tabs plugin from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>. <a href="https://github.com/filamentgroup/Accessible-jQuery-Tabs#readme">Read the project documentation on github</a></p>

<h3>Tree control 
<span class="demo-links">
<a href="/examples/jquery-tree-control/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Tree-Control">code</a>
</span>
</h3>
<p>A jQuery tree control plugin that uses progressive enhancement to transform an unordered list (UL) into a dynamic tree control, complete with accessibility features like ARIA attributes, keyboard and mouse behavior, and focus management (from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>). <a href="/lab/jquery_aria_tree_control_from_book_designing_with_progressive_enhancement/">Read more...</a></p>

<h3>Visualize 
<span class="demo-links">
<a href="/examples/jqueryui-visualize/">demo</a> | 
<a href="https://github.com/filamentgroup/jQuery-Visualize">code</a>
</span>
</h3>
<p>A jQuery plugin for creating accessible charts and graphs that uses JavaScript to scrape data from an HTML table and generate bar, line, area, and pie chart visualizations using the HTML5 canvas element (from our book, <a href="/dwpe"><em>Designing with Progressive Enhancement</em></a>). <a href="/lab/update_to_jquery_visualize_accessible_charts_with_html5_from_designing_with/">Read more...</a></p>




<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>A Fix for the iOS Orientationchange Zoom Bug</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/a_fix_for_the_ios_orientationchange_zoom_bug/" />
      <id>tag:,2012:/lab/6.133</id>
      <published>2012-01-06T04:04:00Z</published>
      <updated>2012-01-06T04:12:06Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="accessibility"
        scheme="http://filamentgroup.com/lab/tag/accessibility/"
        label="accessibility" />
      <category term="javascript"
        scheme="http://filamentgroup.com/lab/tag/javascript/"
        label="javascript" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <category term="responsive design"
        scheme="http://filamentgroup.com/lab/tag/responsive_design/"
        label="responsive design" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Scott on 01/05/2012</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/accessibility/" rel="tag">accessibility</a></dd><dd><a href="http://filamentgroup.com/lab/tag/javascript/" rel="tag">javascript</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd><dd><a href="http://filamentgroup.com/lab/tag/responsive_design/" rel="tag">responsive design</a></dd>
				</dl>
						<p>People enjoy the ability to pinch and zoom websites on their iPhones, iPads, and iPod Touch devices. Unfortunately, a nasty usability bug exists on iOS that causes a user-zoomable page to scale beyond the width of the viewport when the device's orientation changes from portrait to landscape. As a result, the page ends up cropped by the viewport, and users have to manually zoom the page back out again after changing orientation: annoying at best, confusing at worst.</p>
					</div>
		
					<p>The bug has existed for years now; I submitted it to Apple a long, long time ago (The bug report was immediately closed as "duplicate", meaning someone filed it even <em>longer</em> ago. Complementary example <a href="http://filamentgroup.com/examples/iosScaleBug/">here</a>), but it has never been fixed, not in the iOS4.x updates, and not in iOS5 either. <a href="http://twitter.com/adactio">Jeremy Keith</a> recently revived interest in its demise through his post <a href="http://adactio.com/journal/5088/">iWish</a>, which does a nice job of highlighting the history of the issue, and the attempts at working around it so far (none of which quite work as we need them to). </p>

<p>The common workaround is to disable the user's ability to scale the page, which of course fixes the bug by introducing a potentially worse situation. Today, we're offering a workaround that appears to fix the issue without introducing more problems.</p>

<h2>Demo and Code</h2>
<p>To test it out yourself, point an actual iOS device (not an emulator) to <a href="http://scottjehl.github.com/iOS-Orientationchange-Fix/">this test page</a>. </p>

<p>The code for the demo can be found <a href="https://github.com/scottjehl/iOS-Orientationchange-Fix">on Github</a> (check the README file for a minified version). Just add the script to your site and it should do it's thing. Please fork and help improve the code, if you're so inclined!</p>

<h2>How it works</h2>
<p>This fix works by listening to the device's accelerometer to detect when an orientation change is about to occur. When it deems an orientation change imminent, the script disables user zooming, allowing the orientation change to occur properly, with zooming disabled. The script restores zoom again once the device is either oriented close to upright, or after its orientation has changed. This way, user zooming is never disabled while the page is in use.</p>

<p>This fix has been tested on iOS 4 and 5, with expected results. Please post your feedback below!</p>

<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>A Responsive Design Approach for Complex, Multicolumn Data Tables</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/responsive_design_approach_for_complex_multicolumn_data_tables/" />
      <id>tag:,2011:/lab/6.132</id>
      <published>2011-12-29T19:51:00Z</published>
      <updated>2012-01-19T16:26:38Z</updated>
      <author>
            <name>Maggie</name>
                  </author>

      <category term="progressive enhancement"
        scheme="http://filamentgroup.com/lab/tag/progressive_enhancement/"
        label="progressive enhancement" />
      <category term="responsive design"
        scheme="http://filamentgroup.com/lab/tag/responsive_design/"
        label="responsive design" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Maggie on 12/29/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/progressive_enhancement/" rel="tag">progressive enhancement</a></dd><dd><a href="http://filamentgroup.com/lab/tag/responsive_design/" rel="tag">responsive design</a></dd>
				</dl>
						<p>In responsive web design, one of the toughest design problems to solve is how format complex tabular data for display on smaller screens.  In this post, we'll explore an experimental approach to rendering a complex table, using progressive enhancement and responsive design methods, that displays comfortably at a wide range of screen sizes, provides quick access to the data, and preserves the table structure so that data can still be compared across columns.</p>
					</div>
		
					<p>We've been batting around the idea of making tables responsive for awhile. </p>

<p>Our initial attempts to make table data palatable on small screens include showing a <a href="http://jsbin.com/apane6/14/">thumbnail image that links to the data</a> or a <a href="http://jsbin.com/emexa4">canvas-based chart</a>; others have developed responsive CSS workarounds that display a definition list, using either <a href="http://jsbin.com/arixic">list</a> or <a href="http://css-tricks.com/responsive-data-tables/">table</a> markup. Which approach to take depends on the type of data.  For example, structured data where each row is a unique object or entity&#8212;say, business contacts, or favorite Netflix movies&#8212;are well-suited to a definition list style on small screens, because header and cell data can be displayed as simple label and value pairs (i.e., Name: Maggie Wachs, Company: Filament Group...). The switch to a chart or other visualization on smaller screens works well for a simple numeric comparison of a single value. And snapping down to a thumbnail image that launched a full table to pan and zoom was an okay fallback in lieu of no data at all.</p>

<p>But we encountered a scenario that didn't quite work with any of the above solutions: a table of complex of financial data with 6-8 related data points, where comparisons and trends among columns are important to see. Visual relationships between headings and cells, and between neighboring columns, are crucial to understanding the data and would be lost on smaller screens if we displayed a list or chart.</p> 

<p>We needed a happy medium: a way to keep the basic table structure in place&#8212;with headings above, and whole columns that sit side-by-side&#8212;and simultaneously display a manageable amount of data at a size that's comfortably readable.</p>

<h2>A table for every screen</h2>

<p>The approach we devised starts with a full data set, and uses a simple priority-based class designation to display a manageable subset of data columns for common target screen sizes, and also gives the user control to change column visibility easily.</p>

<p>It's probably easier to explain with a concrete example: we'll use a table that lists technology companies and their stock prices and several stock performance metrics.  Each row displays data for a single company; columns organize data points by type for comparison. <a href="/examples/rwd-table-patterns/">View&#160;the&#160;demo</a>.</p>

<p>All data columns will display on desktops and tablets in landscape orientation, but only a subset will fit comfortably on anything smaller.  So the first order of business is to identify which columns of data are essential to see at all screen widths by default, or optional (shown only when space allows).  In our table of tech company stocks, the data is somewhat meaningless without the company name, current stock value, or most recent change, so we'll consider those essential.   The trade time, previous close, and open values would be nice to see if the screen can fit those columns, so we'll make them optional.  The remaining data&#8212;bid, ask, and 1-year target estimate&#8212;are less important in relative terms, so they will appear on only the widest screens.</p>

<p style="text-align: right;"><a href="/examples/rwd-table-patterns/_img/breakpoints.png"><img src="/examples/rwd-table-patterns/_img/breakpoints.png" style="width: 100%;" /></a><br />
<a href="/examples/rwd-table-patterns/_img/breakpoints.png">View larger image</a></p>

<p>In this case, we want users to have the last word regarding which columns to show, so we'll also create a custom menu that lets them choose which columns to display:</p>

<p><img src="/examples/rwd-table-patterns/_img/menu.png" /></p>

<p>The final result is a table that displays a limited set of columns on smaller screens, and provides quick access to data that's hidden because of space constraints (<a href="/examples/rwd-table-patterns/">view&#160;the&#160;demo</a>).  To accomplish this, we'll use progressive enhancement to ensure that we're serving a usable experience to all devices.  We'll start with well-formed, semantic table markup and very basic CSS, and then if the browser is capable, apply JavaScript and enhanced CSS (including media queries) to conditionally show a larger number of columns as screen space allows.</p>


<h2>Markup</h2>

<p>A basic table &#8212; with consecutive columns and descriptive headings &#8212; is an efficient way to display a complex data set; data arranged into columns and rows are easy to scan and compare.  So an HTML table is the clear markup choice for our financial data.</p>

<p>We'll start with a well-formed <code>table</code> that contains a <code>thead</code> for the heading row, followed by a <code>tbody</code> for the cells. </p>

<pre><code>&lt;table cellspacing=&quot;0&quot; id=&quot;tech-companies&quot;&gt;
   &lt;thead&gt;
      &lt;tr&gt;
         ...header cells...
      &lt;/tr&gt;
   &lt;/thead&gt;
   &lt;tbody&gt;
      ...rows of data...
   &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>As we fill in the content, we'll add descriptive classes to identify the essential and optional content.  We'll assign these classes only to the headers; later, we'll write a little JavaScript to map these headers to their respective columns of data.</p>

<pre><code>&lt;thead&gt;
   &lt;tr&gt;
      &lt;th class=&quot;essential persist&quot;&gt;Company&lt;/th&gt;
      &lt;th class=&quot;essential&quot;&gt;Last Trade&lt;/th&gt;
      &lt;th class=&quot;optional&quot;&gt;Trade Time&lt;/th&gt;
      &lt;th class=&quot;essential&quot;&gt;Change&lt;/th&gt;
      &lt;th class=&quot;optional&quot;&gt;Prev Close&lt;/th&gt;
      &lt;th class=&quot;optional&quot;&gt;Open&lt;/th&gt;
      &lt;th&gt;Bid&lt;/th&gt;
      &lt;th&gt;Ask&lt;/th&gt;
      &lt;th&gt;1y Target Est&lt;/th&gt;
   &lt;/tr&gt;
   ...
&lt;/thead&gt;
</code></pre>

<p>Notice that we added a second class to the Company header, <code>persist</code>.  Essential columns are present by default at small screen sizes, but we'll still be able to toggle their visibility with the custom menu.  Marking the Company column with this class provides a way for us to omit it from the menu, and prevent it from being hidden.</p>

<p>We'll complete the table with rows of data that correspond to the column headers:</p>

<pre><code>&lt;table cellspacing=&quot;0&quot; id=&quot;tech-companies&quot;&gt;
&lt;thead&gt;
   ...
&lt;/thead&gt;
&lt;tbody&gt;
   &lt;tr&gt;
      &lt;th&gt;GOOG &lt;span class=&quot;co-name&quot;&gt;Google Inc.&lt;/span&gt;&lt;/th&gt;
      &lt;td&gt;597.74&lt;/td&gt;
      &lt;td&gt;12:12PM&lt;/td&gt;
      &lt;td&gt;14.81 (2.54%)&lt;/td&gt;
      &lt;td&gt;582.93&lt;/td&gt;
      &lt;td&gt;597.95&lt;/td&gt;
      &lt;td&gt;597.73 x 100&lt;/td&gt;
      &lt;td&gt;597.91 x 300&lt;/td&gt;
      &lt;td&gt;731.10&lt;/td&gt;
   &lt;/tr&gt;
   ...
&lt;/tbody&gt;
</code></pre>

<p>Later when we apply JavaScript, we'll create a custom menu based on the table's content and append it to the page, immediately above the table.  The menu will consist of a container element for a "Display" button and the menu overlay:</p>

<pre><code>&lt;div class=&quot;table-menu-wrapper&quot;&gt;
   &lt;a href=&quot;#&quot; class=&quot;table-menu-btn&quot;&gt;Display&lt;/a&gt;
   &lt;div class=&quot;table-menu&quot;&gt;
      ...menu content...   
   &lt;/div&gt;   
&lt;/div&gt;
</code></pre>

<p>The menu overlay will contain a list of options, one for each column, where each option has a <code>label</code> and checkbox <code>input</code> for toggling that column's visibility (columns with the <code>persist</code> class will be excluded from the menu):</p>

<pre><code>&lt;div class=&quot;table-menu-wrapper&quot;&gt;
   &lt;a href=&quot;#&quot; class=&quot;table-menu-btn&quot;&gt;Display&lt;/a&gt;
   &lt;div class=&quot;table-menu&quot;&gt;
      &lt;ul&gt;
         &lt;li&gt;
            &lt;input type=&quot;checkbox&quot; name=&quot;toggle-cols&quot; id=&quot;toggle-col-1&quot; value=&quot;co-1&quot;&gt;
            &lt;label for=&quot;toggle-col-1&quot;&gt;Last Trade&lt;/label&gt;
         &lt;/li&gt;
         &lt;li class=&quot;optional&quot;&gt;
            &lt;input type=&quot;checkbox&quot; name=&quot;toggle-cols&quot; id=&quot;toggle-col-2&quot; value=&quot;co-2&quot;&gt;
            &lt;label for=&quot;toggle-col-2&quot;&gt;Trade Time&lt;/label&gt;
         &lt;/li&gt;
         ...
      &lt;/ul&gt;   
   &lt;/div&gt;   
&lt;/div&gt;
</code></pre>

<p>When the script builds the menu, it will automatically assign <code>name</code> and <code>value</code> attributes and unique IDs to the <code>input</code> elements, and matching <code>for</code> attributes to their labels.</p>

<p>Last but not least, we'll wrap the table in a container element to simplify positioning the menu:</p>

<pre><code>&lt;div class=&quot;table-wrapper&quot;&gt;
   &lt;table cellspacing=&quot;0&quot; id=&quot;tech-companies&quot;&gt;
      ...
   &lt;/table&gt;
&lt;/div&gt;
</code></pre>


<h2>CSS</h2>
<p class="note">We'll assume you're already familiar with using CSS3 media queries to render pages responsively.  If not, we highly recommend Ethan Marcotte's definitive article, <a href="http://www.alistapart.com/articles/responsive-web-design/">Responsive Web Design</a>, and <a href="http://www.abookapart.com/products/responsive-web-design">book by the same title</a>.</p>

<p>Let's start with the table.  We want it to fill the available space, so we'll assign a width of 100%:</p>

<pre><code>table {
   <strong>width: 100%;</strong>
   font-size: 1.2em;
}
</code></pre>

<p>And then apply color, padding, and alignment properties to make the data easier to scan:</p>

<pre><code>thead th {
   white-space: nowrap;
   border-bottom: 1px solid #ccc;
   color: #888;
}
th, td {
   padding: .5em 1em;
   text-align: right;
}
th:first-child, 
td:first-child {
   text-align: left;
}
tbody th, td {
   border-bottom: 1px solid #e6e6e6;
}</code></pre>

<p>Next, we'll write the rules that hide and show columns.  We've scoped these styles to a class, <code>enhanced</code>, which is assigned to the table via JavaScript.  This ensures that column visibility is altered only when JavaScript is available.  By default, we'll hide all columns, and show only those marked with the <code>essential</code> class:</p>

<pre><code>.enhanced th,
.enhanced td {
   display: none;
}
.enhanced th.essential, 
.enhanced td.essential {
   display: table-cell;
}
</code></pre>

<p>Using CSS3 media queries, we'll show optional columns when the browser is 500px wide or greater, and all columns at 800px or greater:</p>

<pre><code>@media screen and (min-width: 500px) {
   .enhanced th.optional, 
   .enhanced td.optional {
      display: table-cell;
   }
}

@media screen and (min-width: 800px) {
   .enhanced th, 
   .enhanced td {
      display: table-cell;
   }
}
</code></pre>

<p class="note">When using this approach, how you prioritize and categorize your data must correspond to the number of screen size breakpoints you plan to support.  In our example, we've chosen to have two breakpoints, at 500 and 800 pixels wide, and two levels of importance, essential and optional.  If we were to add another break point, say around 400px, we would need to rework our categories to include a third (i.e., primary, secondary, tertiary) so that we can mark each column to be visible at a particular breakpoint.</p>

<p>When the custom menu is inserted into the table's container, it will appear just above the table on the right:</p>

<pre><code>.table-menu-wrapper {
   position: absolute;
   top: -3em;
   right: 0;
}
</code></pre>

<p>The menu itself will also be absolutely positioned, and by default will be hidden with the <code>table-menu-hidden</code> class (later, we'll write JavaScript to toggle that class when the "Display" button is clicked):</p>

<pre><code>.table-menu {
   <strong>position: absolute;   
   right: 0;
   left: auto;</strong>
   background-color: #fff;
   padding: 10px;
   border: 1px solid #ccc;
   font-size: 1.2em;
   width: 12em;
}
.table-menu-hidden {
   left: -999em;
   right: auto;
}
</code></pre>

<p>Finally, we'll add relative positioning to the table's container.  Later, when we append the menu we can position it without having to calculate location coordinates:</p>

<pre><code>.table-wrapper {
   <strong>position: relative;</strong>
   margin: 5em 5%;
}
</code></pre>


<h2>JavaScript</h2>

<p>The table we just created is usable on its own; any browser that renders HTML will display it.  With a few JavaScript enhancements, we'll be able to view the table at smaller screen sizes without sacrificing the table structure.  (The following examples use <a href="jquery.com">jQuery</a>.)</p>

<p>First we'll append the <code>enhanced</code> class for scoping styles:</p>

<pre><code>// add class for scoping styles - cells should be hidden only when JS is on
table.addClass("enhanced");</code></pre>

<p>We'll create a container element for the menu, which will come into play a little later in the script:</p>

<pre><code>var container = $('&lt;div class=&quot;table-menu table-menu-hidden&quot;&gt;&lt;ul /&gt;&lt;/div&gt;'); </code></pre>

<p>Then we'll enhance the markup with classes and attributes that allow us to control column visibility.  We'll loop through the table headers and assign them unique IDs, then reference those IDs in <code>headers</code> attributes assigned to associated cells.  (The <code><a href="http://www.w3.org/TR/html4/struct/tables.html#adef-headers">headers</a></code> attribute identifies to which header(s) a cell belongs.)  We'll also copy the classes that we assigned to the column headers &#8212; essential and optional &#8212; and assign them to the associated columns.</p>

<pre><code>$( "thead th" ).each(function(i){
   var th = $(this),
      id = th.attr("id"), 
      classes = th.attr("class");  // essential, optional (or other content identifiers)
         
   // assign an ID to each header, if none is in the markup
   if (!id) {
      id = ( "col-" ) + i;
      th.attr("id", id);
   };      
         
   // loop through each row to assign a "headers" attribute and any classes (essential, optional) to the matching cell
   // the "headers" attribute value = the header's ID
   $( "tbody tr" ).each(function(){
      var cell = $(this).find("th, td").eq(i);                        
      cell.attr("headers", id);
      if (classes) { cell.addClass(classes); };
   });
   ...      
</code></pre>

<p>Next, while still looping through the headers, we'll create a menu item for each column, except for those marked with the <code>persist</code> class.  Each menu item consists of a checkbox and label with the column header text. </p>

<pre><code>   ...  
   // create the menu hide/show toggles
   if ( !th.is(".persist") ) {
   
      // note that each input's value matches the header's ID; 
      // later we'll use this value to control the visibility of that header and it's associated cells
      var toggle = $('&lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;toggle-cols&quot; id=&quot;toggle-col-'+i+'&quot; value=&quot;'+id+'&quot; /&gt; &lt;label for=&quot;toggle-col-'+i+'&quot;&gt;'+th.text()+'&lt;/label&gt;&lt;/li&gt;');
      
      // append each toggle to the container
      container.find("ul").append(toggle);         
      
      ...   
</code></pre>

<p>And then we'll bind events to each checkbox for controlling that column's visibility.  </p>

<pre><code>      ...  
      
      // assign behavior
      toggle.find("input")
      
         // when the checkbox is toggled
         .change(function(){
            var input = $(this), 
                  val = input.val(),  // this equals the header's ID, i.e. "company"
                  cols = $("#" + val + ", [headers="+ val +"]"); // so we can easily find the matching header (id="company") and cells (headers="company")
         
            if (input.is(":checked")) { cols.show(); }
            else { cols.hide(); };		
         })
         
         // custom event that sets the checked state for each toggle based on column visibility, which is controlled by @media rules in the CSS
         // called whenever the window is resized or reoriented (mobile)
         .bind("updateCheck", function(){
            if ( th.css("display") ==  "table-cell") {
               $(this).attr("checked", true);
            }
            else {
               $(this).attr("checked", false);
            };
         })
         
         // call the custom event on load
         .trigger("updateCheck");  
         
   }; // end conditional statement ( !th.is(".persist") )
}); // end headers loop   
</code></pre>

<p>After closing the headers loop, we'll bind our custom event to the window's resize and orientation change events:</p>

<pre><code>// update the inputs' checked status
$(window).bind("orientationchange resize", function(){
   container.find("input").trigger("updateCheck");
}); </code></pre>

<p>And, last but not least, append our checkbox menu to the page and bind show/hide menu events:</p>

<pre><code>var menuWrapper = $('&lt;div class=&quot;table-menu-wrapper&quot; /&gt;'),
   menuBtn = $('&lt;a href=&quot;#&quot; class=&quot;table-menu-btn&quot;&gt;Display&lt;/a&gt;');
      
menuBtn.click(function(){
   container.toggleClass("table-menu-hidden");            
   return false;
});
      
menuWrapper.append(menuBtn).append(container);
table.before(menuWrapper);  // append the menu immediately before the table

// assign click-away-to-close event
$(document).click(function(e){								
   if ( !$(e.target).is( container ) && !$(e.target).is( container.find("*") ) ) {			
      container.addClass("table-menu-hidden");
   }				
}); 
</code></pre>

<h2>Media query support for IE: Respond.js</h2>
<p>Older versions of IE (8 and earlier) don't natively support CSS3 media queries, so we need to use a workaround in those browsers to implement our responsive table. Thanks to our own Scott Jehl, we can use a lightweight polyfill script, <a href="https://github.com/scottjehl/Respond">respond.js</a>, that enables support for min- and max-width media query properties.  The script is open source and available on <a href="https://github.com/scottjehl/Respond">github</a>.</p>

<h2>Keep the conversation going</h2>
<p>The pattern discussed here is one possibility for coding a responsive table.  We hope to discover more, and will update our <a href="https://github.com/filamentgroup/RWD-Table-Patterns">RWD-Table-Patterns</a> git repository as we come across additional use cases.  </p>

<p>This demo code is open source and available for download. Feel free to put it through its paces. If you use it and see room for improvement, please submit a pull request and we'll review it as soon as possible.</p>

<h2>Related plug-ins</h2>
<p>We release open source code, including the design pattern here, to encourage collaboration &#8212; so we're especially excited to learn of new plugins that extend our work.</p>  

<p><a href="http://www.consulenza-web.com/2012/01/mediatable-jquery-plugin/">MediaTable <em>(in Italian)</em></a>, developed by <a href="http://www.consulenza-web.com/">Marco Pegoraro</a>, is a jQuery plugin that applies responsive behavior to one or more standard tables on a page, and also automates the creation of a menu for showing and hiding columns.  It's similar to what we've done here, but in "official" plugin format.  The code is open source and available on <a href="https://github.com/thepeg/MediaTable">github</a>. Thanks, Marco!</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>jQuery Mobile 1.0 Released</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/jquery_mobile_10_released/" />
      <id>tag:,2011:/lab/6.131</id>
      <published>2011-11-17T17:35:00Z</published>
      <updated>2011-11-17T18:21:26Z</updated>
      <author>
            <name>Todd</name>
                  </author>

      <content type="html"><![CDATA[
       <p class="postData">Posted by Todd on 11/17/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					
				</dl>
						<p>When John Resig asked Filament Group to lead this exciting new project about 18 months ago, we had no idea where this would take us. Today, we are so thrilled to announce that jQuery Mobile has reached 1.0 status. </p>
					</div>
		
					<a style="float: right; margin-left: 30px;" href="http://jquerymobile.com/demos"><img title="jquery-mobile-1-final" src="http://jquerymobile.com/wp-content/uploads/2011/11/jquery-mobile-1-final.png" alt="" width="260" /></a>

<p>From the time we first launched the jQuery Mobile site last summer, we were overwhelmed by the enthusiastic response to the principles of the framework. At the time we announced the project, most mobile developers and frameworks had adopted a pretty narrow target: iOS and maybe Android. In our mind, this was a very narrow slice of the web and left many billions of people unable to access important content and tools. </p>

<p>We knew there was an incredible opportunity to take a fresh look at the problem. At Filament Group, our goal is to strive for universal access -- that's what web is all about. For us, that meant that this project should embrace "one web" principles to ensure it worked on any device and for everyone. </p>

<p>We chose the challenging task of making this work on all popular mobile, tablet, e-reader and desktop browsers because the lines between these are blurring so quickly, only a broadly compatible and responsive design system would be future friendly foundation for this project. It took a lot of work, but I'm happy to announce that jQuery Mobile does indeed work <a href="http://jquerymobile.com/gbs/">pretty much anywhere</a>, including feature phones and older browsers though our use of progressive enhancement. We also spent a lot of time testing and adding accessibility features to support screen readers like VoiceOver to ensure that nobody is left behind.</p>

<p>The other part of the universal access equation is making a JavaScript UI like jQuery Mobile toolkit easy to use and I think we've succeeded on that front by exposing all the configuration through HTML5 data- attributes which allows a less technical person to build a complex, AJAX-driven mobile app with simple HTML. Take a look at the <a href="http://jquerymobile.com/test/docs/about/getting-started.html">getting started guide</a> to get a sense of how easy it is to build a mobile website or app with jQuery Mobile. To make building custom themes, we designed the <a href="http://www.jquerymobile.com/themeroller">ThemeRoller</a> tool to make it drop-dead simple to create a theme and download the stylesheet.</p>

<p>For a project that <a href="http://jquerymobile.com/blog/2011/11/16/announcing-jquery-mobile-1-0/">just turned 1.0 today</a>, we already have a vibrant community of plugin and tool developers, eight published books (many more on the way), hundreds of sites and apps in production, and a ton of articles and tutorials. We've collected the best of these on a <a href="http://jquerymobile.com/resources/">resources page</a> on the mobile site. To get started, check out the <a href="http://jquerymobile.com/demos/1.0/">demos and documentation site</a>.</p>

<p>We'd like to thank all the sponsors and contributors to jQuery Mobile. It has been an honor to be part of this project and look forward to 1.1. A huge thanks goes out to Jorge Taylor, <a href="https://twitter.com/#!/kinblas">Kin Blas</a>, <a href="https://twitter.com/#!/johnbender">John Bender</a> and&#160;<a href="https://twitter.com/#!/tybenz">Tyler Benziger</a>, and <a href="https://twitter.com/#!/gseguin">Ghislain Seguin</a> for their incredible work this year on the project, we couldn't have done it without you guys.</p>

<p>We've been pretty quiet here at the lab on the topic of jQuery Mobile because I've been writing more of the week-to-week updates over on the jQuery Mobile blog but look for us to be sharing ideas about how to use and extend the mobile framework.</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Slides from jQuery Mobile State of the Framework 2011, Todd Parker &amp;amp; Scott Jehl</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/jquery_mobile_state_of_framework_2011/" />
      <id>tag:,2011:/lab/6.129</id>
      <published>2011-10-02T14:51:00Z</published>
      <updated>2011-10-02T15:04:51Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="announcements"
        scheme="http://filamentgroup.com/lab/tag/announcements/"
        label="announcements" />
      <category term="jQuery"
        scheme="http://filamentgroup.com/lab/tag/jquery/"
        label="jQuery" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <category term="presentations"
        scheme="http://filamentgroup.com/lab/tag/presentations/"
        label="presentations" />
      <category term="ThemeRoller"
        scheme="http://filamentgroup.com/lab/tag/themeroller/"
        label="ThemeRoller" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by FG on 10/02/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/announcements/" rel="tag">announcements</a></dd><dd><a href="http://filamentgroup.com/lab/tag/jquery/" rel="tag">jQuery</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd><dd><a href="http://filamentgroup.com/lab/tag/presentations/" rel="tag">presentations</a></dd><dd><a href="http://filamentgroup.com/lab/tag/themeroller/" rel="tag">ThemeRoller</a></dd>
				</dl>
						<p>At this fall's jQuery Conference in Boston, MA, Filament Group's Todd Parker and Scott Jehl presented the jQuery Mobile Framework keynote. The session covered the current state of the project, an overview of the releases since the first alpha last fall, direction for how best to make use of the framework today, and some upcoming tools such as a new ThemeRoller (<a href="http://www.youtube.com/watch?v=REfFWx5eUVI">video preview</a>), and download builder.</p>


					</div>
		
					<p>The slides from Todd and Scott's presentation are embedded below (also <a href="http://speakerdeck.com/u/scottjehl/p/todd-parker-scott-jehl-jquery-mobile-keynote-2011">available on SpeakerDeck</a>, and video from the session may be available at a later time.</p>

<div style="width: 100%; overflow: auto;">
<script src="http://speakerdeck.com/embed/4e875d5ff06c200050007f85.js?size=preview"></script>
</div>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Future&#45;Friendly: Forward&#45;Thinking Thoughts on Web Development</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/future_friendly/" />
      <id>tag:,2011:/lab/6.128</id>
      <published>2011-10-02T13:45:00Z</published>
      <updated>2011-10-02T14:44:09Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="events"
        scheme="http://filamentgroup.com/lab/tag/events/"
        label="events" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <category term="web standards"
        scheme="http://filamentgroup.com/lab/tag/web_standards/"
        label="web standards" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by FG on 10/02/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/events/" rel="tag">events</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd><dd><a href="http://filamentgroup.com/lab/tag/web_standards/" rel="tag">web standards</a></dd>
				</dl>
						<p>When a small group of web designers and developers, including <a href="http://www.lukew.com">Luke Wroblewski </a>, <a href="http://bradfrostweb.com/">Brad Frost</a>, <a href="http://lyza.com/">Lyza Danger Gardner</a>, <a href="http://yiibu.com/"> Stephanie and Bryan Rieger</a>, <a href="http://designmind.frogdesign.com/blog/author/beyond-mobile/">Scott Jensen</a>, <a href="http://adactio.com/">Jeremy Keith</a>, <a href="http://userfirstweb.com/">Jason Grigsby</a>, <a href="http://globalmoxie.com/">Josh Clark</a>, and our own Scott Jehl, decided to hole up in a cabin in the woods of Tennessee for a few days, we weren't sure what to expect, but it seemed too good an opportunity to pass up. </p>
<p>The retreat, which took place after the Breaking Development conference in Nashville, was dubbed "MobileWood": 3 days of intense discussion, debate, and agreement on a general direction for those interested in developing websites and applications that work well today, and are ready for tomorrow. </p> 

					</div>
		
					<p>The outcome of the MobileWood retreat is <a href="http://futurefriend.ly">Future-Friendly</a>, a new site including a manifesto of sorts, and a set of patterns and resources that will continue to grow over time.  We recommend checking out the site, and hope that its resources will help you convince others of the value in embracing standards-based, inclusive, and sustainable web development practices moving forward.</p>

<p><a href="http://futurefriend.ly"><img src="/images/fflogo.png" alt="Future-Friendly Logo"></a></p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Slides from Responsive &amp;amp; Responsible, Scott Jehl, Breaking Dev 2011</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/slides_from_responsive_responsible_scott_jehl_breaking_dev_2011/" />
      <id>tag:,2011:/lab/6.127</id>
      <published>2011-10-02T13:27:01Z</published>
      <updated>2011-10-02T13:39:09Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="accessibility"
        scheme="http://filamentgroup.com/lab/tag/accessibility/"
        label="accessibility" />
      <category term="css"
        scheme="http://filamentgroup.com/lab/tag/css/"
        label="css" />
      <category term="presentations"
        scheme="http://filamentgroup.com/lab/tag/presentations/"
        label="presentations" />
      <category term="progressive enhancement"
        scheme="http://filamentgroup.com/lab/tag/progressive_enhancement/"
        label="progressive enhancement" />
      <category term="responsive design"
        scheme="http://filamentgroup.com/lab/tag/responsive_design/"
        label="responsive design" />
      <category term="web standards"
        scheme="http://filamentgroup.com/lab/tag/web_standards/"
        label="web standards" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by FG on 10/02/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/accessibility/" rel="tag">accessibility</a></dd><dd><a href="http://filamentgroup.com/lab/tag/css/" rel="tag">css</a></dd><dd><a href="http://filamentgroup.com/lab/tag/presentations/" rel="tag">presentations</a></dd><dd><a href="http://filamentgroup.com/lab/tag/progressive_enhancement/" rel="tag">progressive enhancement</a></dd><dd><a href="http://filamentgroup.com/lab/tag/responsive_design/" rel="tag">responsive design</a></dd><dd><a href="http://filamentgroup.com/lab/tag/web_standards/" rel="tag">web standards</a></dd>
				</dl>
						<p>At this summer's Breaking Development in Nashville, TN, Filament Group's own Scott Jehl presented on our work on the new, responsive <a href="http://bostonglobe.com">BostonGlobe.com</a>. The Boston Globe is one of the first major sites to implement responsive design at a large scale, and this presentation covered many of the challenges and solutions we encountered during that development process (including <a href="http://filamentgroup.com/lab/respondjs_fast_css3_media_queries_for_internet_explorer_6_8_and_more/">Respond.js</a>: a patch for CSS3 Media Query support in Internet Explorer 6-8, <a href="http://filamentgroup.com/lab/responsive_images_experimenting_with_context_aware_image_sizing/">Responsive Images</a>, and more). </p>
					</div>
		
					<p>The slides from Scott's presentation are embedded below (also <a href="http://speakerdeck.com/u/scottjehl/p/responsive-responsible">available on SpeakerDeck</a>, and as a <a href="filamentgroup.com/examples/bdconf-2011/sjehl-bdconf-2011.pdf">downloadable PDF</a>), and video from the session will be available later this fall.</p>

<div style="overflow: auto; width: 100%;">
<script src="http://speakerdeck.com/embed/4e80d6b4750822006000044c.js?size=preview"></script>
</div>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Introducing the new responsive&#45;designed BostonGlobe.com</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/introducing_the_new_responsive_designed_bostonglobecom/" />
      <id>tag:,2011:/lab/6.126</id>
      <published>2011-09-12T14:17:00Z</published>
      <updated>2011-09-12T17:28:43Z</updated>
      <author>
            <name>Patty</name>
                  </author>

      <category term="accessibility"
        scheme="http://filamentgroup.com/lab/tag/accessibility/"
        label="accessibility" />
      <category term="announcements"
        scheme="http://filamentgroup.com/lab/tag/announcements/"
        label="announcements" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <category term="progressive enhancement"
        scheme="http://filamentgroup.com/lab/tag/progressive_enhancement/"
        label="progressive enhancement" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Patty on 09/12/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/accessibility/" rel="tag">accessibility</a></dd><dd><a href="http://filamentgroup.com/lab/tag/announcements/" rel="tag">announcements</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd><dd><a href="http://filamentgroup.com/lab/tag/progressive_enhancement/" rel="tag">progressive enhancement</a></dd>
				</dl>
						<p>The Boston Globe flipped the switch today on its accessible, progressive enhancement and responsive-design based subscription news site. As front-end development leads on the project (with Ethan Marcotte at our side), we're very honored to have been involved.</p>

					</div>
		
					<a href="http://www.bostonglobe.com" style="float:right; margin-left:20px; margin-right:-10px;"><img src="/images/bostonglobe-feat-promo.jpg" alt="New Boston Globe responsive site" width="320"></a>

<p>Early this morning, the team at the Boston Globe flipped the switch on an incredibly ambitious new web site, and the 139-year-old Award-winning American newspaper gained a proper home of its own on the web. As Boston locals and long-time subscribers to the paper, we're quite proud of the Globe and what they've accomplished with this launch; as front-end development leads on the project, we're honored to have been involved, and thrilled with the quality of the site in action.</p>

<p><a href="http://bostonglobe.com">BostonGlobe.com</a> &#8211; which should not be confused with its still-existing sister site, <a href="http://boston.com">Boston.com</a> &#8211; brings the Globe's premium journalism and reporting to the web in a way that is accessible and a pleasure to use on most any device - whether that's an old BlackBerry, an iPhone or iPad, or a desktop browser. </p>

<p>Better yet, they've managed to achieve this cross-device support with a single codebase that takes advantage of features available in the latest devices and browsers, such as touch gestures and offline browsing.  For some background on the approach, check out <a href="http://www.boston.com/bostonglobe/features/">the features page</a>, and the <a href="http://www.boston.com/video/viral_page/?/services/player/bcpid1126033626001&bckey=AQ~~,AAAAAA6piHY~,DqRT40XOAr9oz3xbfbE6ZVB8_5Kgdym2&bctid=1150525821001">tech overview video</a> (which includes interviews with the Filament Group team discussing some of the more interesting challenges and solutions we encountered in implementing a large-scale mobile-first responsive design).</p>


<p>We plan to cover the technical challenges and solutions in depth on this blog in the near future. But in the meantime, we wanted to note some of the important discoveries we made about what makes a responsive design project of this magnitude possible: </p>

<ul>
<li>You need <strong>a client willing to make a real commitment</strong> to embracing standards, expanding their expectations about brand and user experience, and most importantly, transforming their internal work processes to incorporate new principles and methodologies.  Globe publisher Chris Mayer, Editor Marty Baron, and most especially Jeff Moriarty, Miranda Mulligan and the entire Boston Globe development team were beyond exemplary in this regard.</li>
<li>You need <strong>a visionary thinker who can articulate the vision of this new idea</strong>, and we had that in spades in our colleague <a href="http://unstoppablerobotninja.com/">Ethan Marcotte</a>, the inventor and father/godfather/grandfather/chief prophet of responsive design.  (If you have any interest at all in responsive design techniques and haven't read <a href="http://www.abookapart.com/products/responsive-web-design">his book on the subject</a>, you should.)</li>
<li>You need <strong>visual designers who understand and embrace the challenge</strong>, and our wishes were superceded time and again by our tireless & fearless leader Miranda Mulligan at the Globe, and the unbelievable team of Tito Bottitta, Mike Swartz and Jared Novack at <a href="http://upstatement.com/">Upstatement</a>.  That their visual design is gorgeous, elegant, and a true pleasure is self-evident.  But we could not have arrived at such a solution were they not genuine, welcoming collaborators.</li>
<li>Particularly in these relatively uncharted waters, you need <strong>highly skilled front-end developers who understand standards, progressive enhancement techniques, cutting-edge coding best practices and responsive design principles</strong>.  We are so continually impressed with our own Scott Jehl, Mat Marquis, and Maggie Wachs, who make a practice of inventing fantastic, magically innovative new code techniques from thin air on a daily basis&mdash;and can also sit down and explain them so the rest of the team can understand and build on them. They are amazing.</li>
<li>Finally, you need <strong>to be at the right place, at the right time, with all of the above at the ready</strong>. We've worked together for ten years now, and have been talking about and working toward a vision of a single code base that is accessible, and thoughtfully delivers an appropriate experience to the vast array of devices. This project has been the culmination of years of thinking and guessing and hoping, and we feel is validating many of our hopes for how the web can and should work.</li>
</ul>

<p>To say we're thrilled with the result is a serious understatement.  We're excited to see how the site evolves, and how the discussion about responsive design and the web does as well.</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>jQuery Mobile Pagination Plugin</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/jquery_mobile_pagination_plugin/" />
      <id>tag:,2011:/lab/6.125</id>
      <published>2011-08-24T14:09:00Z</published>
      <updated>2011-08-24T15:31:54Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="ajax"
        scheme="http://filamentgroup.com/lab/tag/ajax/"
        label="ajax" />
      <category term="css"
        scheme="http://filamentgroup.com/lab/tag/css/"
        label="css" />
      <category term="javascript"
        scheme="http://filamentgroup.com/lab/tag/javascript/"
        label="javascript" />
      <category term="jQuery"
        scheme="http://filamentgroup.com/lab/tag/jquery/"
        label="jQuery" />
      <category term="mobile"
        scheme="http://filamentgroup.com/lab/tag/mobile/"
        label="mobile" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by Scott on 08/24/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/ajax/" rel="tag">ajax</a></dd><dd><a href="http://filamentgroup.com/lab/tag/css/" rel="tag">css</a></dd><dd><a href="http://filamentgroup.com/lab/tag/javascript/" rel="tag">javascript</a></dd><dd><a href="http://filamentgroup.com/lab/tag/jquery/" rel="tag">jQuery</a></dd><dd><a href="http://filamentgroup.com/lab/tag/mobile/" rel="tag">mobile</a></dd>
				</dl>
						<p><a href="http://filamentgroup.com/examples/jqm-pagination/demo/" class="callout_text"><img src="/images/jqm-pagination-screen.png" alt="jQuery Mobile Pagination Screenshot"></a>It's been a little while since we've released any code examples here in the FG Lab, so today we're happy to present a 
new <a href="http://jquerymobile.com">jQuery Mobile</a> plugin called <a href="https://github.com/filamentgroup/jqm-pagination">Pagination</a>: a jQuery Mobile plugin for sequential pagination between pages with support for touch, mouse, and keyboard!</p>

<p>The Pagination plugin creates touch-drag navigation between separate HTML pages. Simply add this plugin to your page and link together documents via ordinary HTML anchors. The linked pages will pre-fetch, and in browsers that support touch events, you'll be able to drag between the linked pages, while desktop users can navigate with mouse or keyboard. Like all navigation in jQuery Mobile, this plugin ties into your browser's history, so bookmarking, and using the browser's back and forward buttons work as expected!</p>

					</div>
		
					<h2>A Quick Demo</h2>
<p>The following is a demo of the pagination plugin. There are 4 separate pages linked in the demo. On touch devices, you can drag between the pages. Note that this plugin works with any HTML page content, though we made a series of photos for demo purposes.</p>

<p><a href="http://filamentgroup.com/examples/jqm-pagination/demo/" class="book-site">jQuery Mobile Pagination Demo</a></p>

<h2>How it works</h2>
<p>This plugin requires jQuery and jQuery Mobile. It doesn't require the whole jQM framework though, so we'll try and document the specifics for that later on.</p>

<p>To Use:</p>
<ol>
	<li>Reference <code>jquery.mobile.pagination.css</code> and <code>jquery.mobile.pagination.js</code> from your page.</li>
	<li>Place the following markup somewhere inside each document that you want to make draggable. The links should point to the next and previous pages.</li>
</ol>

<pre><code>
&lt;ul data-role=&quot;pagination&quot;&gt;
	&lt;li class=&quot;ui-pagination-prev&quot;&gt;&lt;a href=&quot;2.html&quot;&gt;Prev&lt;/a&gt;&lt;/li&gt;
	&lt;li class=&quot;ui-pagination-next&quot;&gt;&lt;a href=&quot;4.html&quot;&gt;Next&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>That's it! You can link a series of pages together by placing that markup in the body of each page, pointing to the next and previous pages for each one, respectively.</p>

<h2>Download, Fork on Github!</h2>
<p>This code is open source and free to download and use on any projects, via the MIT or GPL licenses, like jQuery Mobile itself. You can grab it on Github:</p>
<p><a href="https://github.com/filamentgroup/jqm-pagination" class="book-site">jQM Pagination on Github</a></p>

<h3>Support</h3>
<p>The keyboard and mouse/tap support should work in pretty much any browser or device, following jQuery Mobile's browser support grades. The touch gestures tested well on all iOS devices, Android 2.2 and 2.3 phones and tablets. Android 2.1 and Blackberry Playbook support is a little flakey, but the pages are navigable via the arrow links as a fallback in any browser.</p>

<p>Got ideas or improvements? Please fork and contribute!</p>
<a href=""></a>
      ]]></content>
    </entry>

    <entry>
      <title>Filament Group&#8217;s Scott Jehl to Present at Breaking Dev</title>
      <link rel="alternate" type="text/html" href="http://filamentgroup.com/lab/filament_groups_scott_jehl_to_present_at_breaking_dev/" />
      <id>tag:,2011:/lab/6.124</id>
      <published>2011-07-26T15:28:01Z</published>
      <updated>2011-07-26T17:19:02Z</updated>
      <author>
            <name>Scott</name>
                  </author>

      <category term="announcements"
        scheme="http://filamentgroup.com/lab/tag/announcements/"
        label="announcements" />
      <category term="events"
        scheme="http://filamentgroup.com/lab/tag/events/"
        label="events" />
      <category term="presentations"
        scheme="http://filamentgroup.com/lab/tag/presentations/"
        label="presentations" />
      <content type="html"><![CDATA[
       <p class="postData">Posted by fg on 07/26/2011</p>

<dl class="topics">
					<dt>Topics:</dt>
					<dd><a href="http://filamentgroup.com/lab/tag/announcements/" rel="tag">announcements</a></dd><dd><a href="http://filamentgroup.com/lab/tag/events/" rel="tag">events</a></dd><dd><a href="http://filamentgroup.com/lab/tag/presentations/" rel="tag">presentations</a></dd>
				</dl>
						<p>Filament Group's Scott Jehl will presenting at this year's <a href="http://www.bdconf.com/">Breaking Dev Conference</a>, September 12-14th in Nashville, Tennessee. While Scott's topic is yet to be announced, it will likely cover techniques surrounding responsive design, cross-device development with jQuery Mobile, or maybe something in between.</p>

<p><img src="/images/breakingdev.png" alt="Breaking Dev conference logo" /></p>

<p>The conference is sure to be great, with presentations by Jeremy Keith, Stephanie and Bryan Rieger, Steve Souders, Josh Clark, Jason Grigsby, Luke Wroblewski, James Pearce, John Boxall, Dave Johnson, Maximiliano Firtman, and Nick Finck.</p>
<p><a href="https://www.bdconf.com/register">Tickets are still available</a>, and the first 10 people to register using Scott's discount code <code>TNJEH11</code> will get $100 off the price of either a Conference Only pass or a Conference plus All Workshops pass. We hope to see you there!</p> 
					</div>
		
					
<a href=""></a>
      ]]></content>
    </entry>


</feed>
