SlideShare a Scribd company logo
ADAPTIVE WEB DESIGN WORKSHOP




    The Agenda
๏   Progressive Enhancement

    ‣ vs Graceful Degradation

    ‣ How & Why It Works

๏   Content & Organization
๏   Semantics

    ‣ HTML5

    ‣ Microformats




                                   2
ADAPTIVE WEB DESIGN WORKSHOP




    The Agenda
๏   Design

    ‣ Parsing Errors

    ‣ Designing in Layers

    ‣ Adaptive (& Responsive) Layouts

    ‣ “Mobile First”
๏   Interactivity

    ‣ Unobtrusive JavaScript
    ‣ Adaptive Interfaces

    ‣ Hijax

                                        3
ADAPTIVE WEB DESIGN WORKSHOP




    The Agenda
๏   Accessibility

    ‣ Design Considerations

    ‣ ARIA




                                   4
VillageReach.org
Progressive
Enhancement
?
Technological
 restrictions
Adaptive Web Design [WebVisions Portland 2012]
MCMLXXVII
MCMLXXVII
  (that’s 1977)
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
HTML   CSS
fault tolerance
n. a system’s ability to continue to
operate when it encounters and
unexpected error.
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Browsers IGNORE
 what they don’t
   understand
I like an escalator because
an escalator can never break,
it can only become stairs.
             — Mitch Hedberg
Graceful
Degradation
Modern
Browsers
   Older Browsers
Modern
Browsers
   Older Browsers
Progressive
Enhancement
Progressive
Graceful Degradation   Enhancement
Content
Content
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Ooooh.
Shiny!
Progressive
Enhancement
 ISN’T about
  browsers.
Browsers and
 technologies
COME AND GO
Don’t lose sight
of your USERS
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience



                     Accessibility

                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience



                          ARIA

                      JavaScript

                           CSS

                         HTML
             BASIC                          ADVANCED

                     Browser Capabilities


                     Text & HTTP
HTML
HTML5

HTML
Microformats
  HTML4
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Content
 is WHY
we build
websites
Clear,
well-written
prose is key.
Organize
 & prioritize
your content
Don’t
obscure
content.
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Header

                       Nav
Features

                      Extra

                       Social
Programs
                    Newsletter



 News



           Footer
Header

Features               Nav

Programs              Extra

 News                 Social

                    Newsletter

           Footer
User Experience




             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Semantics 101
 <p>HTML5 introduces several <em>really</em>
 useful elements and a ton of new APIs.</p>


 <p>Please fill out the form below.
 <strong>Note: all fields are required.</strong></p>


 <p>I like to work with markup languages because
 <strong>they are simple and easy to read</strong>.
 They also have that certain <i lang="fr" title="I
 don&#8217;t know what">je ne sais quoi</i>.</p>
ADAPTIVE WEB DESIGN WORKSHOP




Semantics 101




                               small
ADAPTIVE WEB DESIGN WORKSHOP




Semantics 101


                               hr
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <figure id="fig-1">
  <img src="photo.jpeg" alt=""/>
  <figcaption>Photo of Albert Einstein</figcaption>
 </figure>


 <figure id="fig-2">
  <table>
    <caption>2011 Forecast Earnings</caption>
    <!-- a bunch of data -->
  </table>
 </figure>
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <section>
  <!-- pretty much anything can go here -->
 </section>


 <article>
  <!-- pretty much anything can go here -->
 </article>
section
section > article
article
article > section
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <header>
  <!-- titles, etc. go here -->
 </header>


 <footer>
  <!-- meta/supplementary information goes here -->
 </footer>
header
footer
article
article > header
article
article > footer
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 <nav>
  <ol>
    <li><a href="#details">Details</a></li>
    <li><a href="#lodging">Lodging</a></li>
    <li><a href="#location">Location</a></li>
    <li><a href="#topics">Topics</a></li>
    <li><a href="#contact">Contact Us</a></li>
  </ol>
  <p><a href="register">Register Now</a>
    <b>Only 5 spaces left</b></p>
 </nav>
nav
nav
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Implicit sections (HTML4)
                               <h1> HTML5
                               <p> HTML5 is currently under development...
                               <p> Like its immediate predecessors, HTML...


                               <h2> W3C standardization process
                               <p> The Web Hypertext Application...
                               <p> The HTML5 specification...
                               <p> According to the W3C timetable...
                               <p> Ian Hickson, editor of the HTML5...


                               <h2> Markup
                               <p> HTML5 introduces a number of...
                               <p> The HTML5 syntax is no longer...




                                1 HTML5
                                1.1 W3C standardization process
                                1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




Explicit sections (HTML5)
                                    <h1> HTML5
                                    <p> HTML5 is currently under development...
                                    <p> Like its immediate predecessors, HTML...


                                    <h2> W3C standardization process
                          section


                                    <p> The Web Hypertext Application...
                                    <p> The HTML5 specification...
                                    <p> According to the W3C timetable...
                                    <p> Ian Hickson, editor of the HTML5...


                                    <h2> Markup
                          section




                                    <p> HTML5 introduces a number of...
                                    <p> The HTML5 syntax is no longer...




                                     1 HTML5
                                     1.1 W3C standardization process
                                     1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




Explicit sections (HTML5)
                                    <h1> HTML5
                                    <p> HTML5 is currently under development...
                                    <p> Like its immediate predecessors, HTML...


                                    <h1> W3C standardization process
                          section


                                    <p> The Web Hypertext Application...
                                    <p> The HTML5 specification...
                                    <p> According to the W3C timetable...
                                    <p> Ian Hickson, editor of the HTML5...


                                    <h1> Markup
                          section




                                    <p> HTML5 introduces a number of...
                                    <p> The HTML5 syntax is no longer...




                                     1 HTML5
                                     1.1 W3C standardization process
                                     1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




Explicit sections (HTML5)
                                    <h1> HTML5
                                    <p> HTML5 is currently under development...
                                    <p> Like its immediate predecessors, HTML...


                                    <h4> W3C standardization process
                          section


                                    <p> The Web Hypertext Application...
                                    <p> The HTML5 specification...
                                    <p> According to the W3C timetable...
                                    <p> Ian Hickson, editor of the HTML5...


                                    <h6> Markup
                          section




                                    <p> HTML5 introduces a number of...
                                    <p> The HTML5 syntax is no longer...




                                     1 HTML5
                                     1.1 W3C standardization process
                                     1.2 Markup
ADAPTIVE WEB DESIGN WORKSHOP




    Sections
๏   section
๏   article
๏   aside
๏   nav




                                   81
ADAPTIVE WEB DESIGN WORKSHOP




Outline limitations in HTML4
                               <h1> Title
                               <h2> Subtitle
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...




                                1 Title
                                1.1 Subtitle
ADAPTIVE WEB DESIGN WORKSHOP




Heading groups (HTML5)

                          hgroup
                                   <h1> Title
                                   <h2> Subtitle
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...
                                   <p> Text content continues...




                                    1 Title
ADAPTIVE WEB DESIGN WORKSHOP




Aside: rooted sections
                               <h1> Title
                               <p> Text content continues...
                               <p> Text content continues...


                               <h2> Section heading
                               <p> Text content continues...
                               <blockquote>
                                 <h2> Rooted heading
                                 <p> Text content continues...
                                 <p> Text content continues...
                               <p> Text content continues...
                               <p> Text content continues...




                                1 Title
                                1.1 Section heading
ADAPTIVE WEB DESIGN WORKSHOP




    Sectioning roots
๏   body
๏   blockquote
๏   details
๏   fieldset
๏   figure
๏   td




                                   85
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Dates & Times
 <input type="date" name="dob"/>
ADAPTIVE WEB DESIGN WORKSHOP




Numbers
 <input type="number" name="foo"/>




 <input type="range" min="1" max="11" name="foo"/>
ADAPTIVE WEB DESIGN WORKSHOP




Format validation
 <input type="email" …/>       <input type="url" …/>
ADAPTIVE WEB DESIGN WORKSHOP




Format validation
 <input type="text"
        pattern="d{6}w{3}"
        placeholder="6 digits followed by 3 letters"
        .../>
Ad-hoc
Semantics
ADAPTIVE WEB DESIGN WORKSHOP




Classification
ADAPTIVE WEB DESIGN WORKSHOP




Identification
ADAPTIVE WEB DESIGN WORKSHOP




Microformats
 <section class="vcard">
  <figure>
    <img class="photo" src="aaron-gustafson.jpg" alt=""/>
  </figure>
  <h1 class="fn">Aaron Gustafson</h1>
  …
  <p>Aaron … is <b class="role">Group Manager</b> of the
    <a class="org" href="http://webstandards.org">Web
    Standards Project (WaSP)</a> ….</p>
 </section>
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Header
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="header">
  <a href="#donate" class="donate-link"
     title="Click here to view our donation options">Donate</a>
  <a href="http://villagereach.org/feed/" class="rss-link"
     title="View our RSS Feed">RSS Feed</a>
  <div id="site-title">
    <a href="http://villagereach.org" title="Village Reach: Home">
     <span>Village Reach</span>
    </a>
  </div>
 </div><!-- #header -->
Adaptive Web Design [WebVisions Portland 2012]
Features




Programs




 News
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div class="entry-content entry">
  <!-- Features -->
  <div class="boxes three home">
    <!-- Programs -->
  </div>
  <div id="latestNews">
    <!-- Latest News -->
  </div>
 </div>
Adaptive Web Design [WebVisions Portland 2012]
Nav
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="hybrid-search-3" class="widget search widget-search">
  <div class="widget-inside">
    <form method="get" class="search-form" id="search-form"
 action="http://villagereach.org/">
      <!--Search Form -->
    </form><!-- .search-form -->
  </div>
 </div>
 <div id="navigation">
  <div id="page-nav" class="page-nav">
    <ul class="menu sf-menu">
      <!-- Navigation -->
    </ul>
  </div>
 </div><!-- #navigation -->
Adaptive Web Design [WebVisions Portland 2012]
Extra

   Social


Newsletter
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="text-8" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Extra -->
  </div>
 </div>
 <div id="text-7" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Social -->
  </div>
 </div>
 <div id="mc_signup_container">
  <!-- Newsletter -->
 </div>
Adaptive Web Design [WebVisions Portland 2012]
Footer
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <div id="footer-container">
  <div id="footer">
    <p class="copyright">Copyright &#169; 2011 <a class="site-link"
 href="http://villagereach.org" title="VillageReach"
 rel="home"><span>VillageReach</span></a>. - All rights
 reserved.</p>
  </div><!-- #footer -->
 </div><!-- #footer-container -->
User Experience




                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors


                               p{
                                 color: red;
                               }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors


                               p{
                                 color: red;
                                 font-weight: bold;
                               }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 p {
   color: #ccc;
   color: rgba( 0, 0, 0, .5 );
 }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 html[lang] p {
   color: #ccc;
   color: rgba( 0, 0, 0, .5 );
 }
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 @-moz-document url-prefix() {
   html[lang] p {
     color: #ccc;
     color: rgba( 0, 0, 0, .5 );
   }
 }
#intro {
  /* Basic Layout */
}

/* ... */

body[id=css-zen-garden] #intro {
 /* Advanced Layout */
}
#intro {
  /* Basic Layout */
}

/* ... */

[foo], #intro {
  /* Advanced Layout */
}
ADAPTIVE WEB DESIGN WORKSHOP




Parsing errors
 @import 'not-for-IE7-or-below.css' screen;

 @media screen, print, refrigerator {
   /* IE will get these rules */
 }
ADAPTIVE WEB DESIGN WORKSHOP




Organization



                               design
ADAPTIVE WEB DESIGN WORKSHOP




Organization


                               type        color


                                  layout
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 /* =Typography */
 img {
   display: block;
 }

 /* =Layout */
 @media screen {
   .frame .inner {
     border: 10px solid;
   }
 }

 /* =Color */
 .frame .inner {
   background-color: rgb(227, 222, 215);
   border-color: rgb(227, 222, 215);
 }
ADAPTIVE WEB DESIGN WORKSHOP




Organization

                  type.css




                 layout.css    main.css




                  color.css
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 {embed="styles/typography"}

 @media screen {
   {embed="styles/layout-screen"}
 }

 {embed="styles/color"}
                                    Example using ExpressionEngine embed tags
ADAPTIVE WEB DESIGN WORKSHOP




Organization
 {embed="styles/reset"}

 {embed="styles/typography"}

 @media screen {
   {embed="styles/layout-screen"}
 }

 @media print {
   {embed="styles/layout-print"}
 }

 {embed="styles/color"}

 {embed="styles/effects"}
                                    Example using ExpressionEngine embed tags
ADAPTIVE WEB DESIGN WORKSHOP




Monkey-patching
 <link rel="stylesheet" href="main.css"/>
 <!--[if IE 9]><link rel="stylesheet" href="ie9.css"/><![endif]-->
 <!--[if lte IE 8]><link rel="stylesheet" href="ie8.css"/><![endif]-->
 <!--[if lte IE 7]><link rel="stylesheet" href="ie7.css"/><![endif]-->
 <!--[if lte IE 6]><link rel="stylesheet" href="ie6.css"/><![endif]-->
ADAPTIVE WEB DESIGN WORKSHOP




Monkey-patching
 @-moz-document url-prefix() {

       /* GENERATED CONTENT - FF3 doesn't allow positioning */
       #extra-mile:before {
          content: '';
       }
       #extra-mile:first-of-type:before {
          content: url(extra-mile-sign.png);
       }

 }
Adaptive Web Design [WebVisions Portland 2012]
PROGRESSIVE ENHANCEMENT & MOBILE




@Media blocks
 @media screen {
   /* Styles for screen media only */
 }
PROGRESSIVE ENHANCEMENT & MOBILE




@Media blocks+
 @media screen and (max-width:450px) {
   /* Styles for screen media when browser
      is 450px wide or below */
 }
PROGRESSIVE ENHANCEMENT & MOBILE




Don’t do this
 @media
   screen and (min-device-width:1024px)
          and (max-width:989px),
   screen and (max-device-width:480px),
   screen and (max-device-width:480px)
          and (orientation:landscape),
   screen and (min-device-width:481px)
          and (orientation:portrait) {
   /* Layout for narrower desktop (below 990px)
      or
      iPhone running iOS 3 (or equivalent)
      or
      iPhone running iOS 4 (or equivalent) in “landscape” view
      or
      iPad (or equivalent) in “portrait” view */
 }
PROGRESSIVE ENHANCEMENT & MOBILE




Mobile First w/ media queries
 /* Universal Layout */

 @media screen {
   /* Styles for all screens */
 }

 @media screen and (min-width:481px) {
   /* Styles for all screens 480px+ width */
 }

 @media screen and (min-width:754px) {
   /* Styles for all screens 754px+ width */
 }
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
PROGRESSIVE ENHANCEMENT & MOBILE




Mobile First w/ media queries
 #hd {
   background: url(hd-bg-small.png) repeat-x 50% 50%;
 }
 #hd .logo a {
   background: url(logo-small.png) no-repeat 50% 0;
   display: block;
   width: 240px;
   height: 109px;
   /* … */
 }
 @media screen and (min-width: 481px) {
   #hd {
     background: url(hd-bg.png) no-repeat 50% 52px;
   }
   #hd .logo a {
     background-image: url(logo.png);
     width: 342px;
     height: 155px;
   }
 }
Header

                       Nav
Features

                      Extra

                       Social
Programs
                    Newsletter



 News



           Footer
Adaptive Web Design [WebVisions Portland 2012]
Header

                       Nav
Features

                      Extra

                       Social
Programs
                    Newsletter



 News



           Footer
User Experience




                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience




                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Photo credit: spike55151
ADAPTIVE WEB DESIGN WORKSHOP




Sins of our past
 <a href="javascript:someFunction();">some text</a>


 <a href="javascript:void(null);"
    onclick="someFunction();">some text</a>


 <a href="#" onclick="someFunction();">some text</a>
ADAPTIVE WEB DESIGN WORKSHOP




A minor improvement
 <a href="http://offsite.com"
    onclick="newWin( this.href ); return false;">
    some text</a>
Photo credit: Giando
ADAPTIVE WEB DESIGN WORKSHOP




Event listeners
 window.onload = handleExternalLinks;

 function handleExternalLinks()
 {
   var server = document.location.hostname;
   var anchors = document.getElementsByTagName("a");
   var i, href;
   for( i=0; i < anchors.length; i++ )
   {
     href = anchors[i].href;
     if ( href.indexOf("http://" + server) == -1 &&
           href.indexOf("https://" + server) == -1 )
     {
        // HREF is not a file on my server
        anchors[i].onclick = function()
        {
           newWin( this.href );
        };
     }
   }
 }
Photo credit: hebedesign
ADAPTIVE WEB DESIGN WORKSHOP




Listen and delegate
 document
   .getElementsByTagName( 'body' )[0]
     .onclick = clickDelegator;

 function clickDelegator( e )
 {
   e = ( e ) ? e : event;
   var el = e.target || e.srcElement;
   // external links
   if ( el.nodeName.toLowerCase() == 'a' &&
        el.getAttribute( 'rel' ) == 'external' )
   {
      newWin( el.href );
   }
 }
Photo credit: ambery
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Without JavaScript
With JavaScript
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Source of blog entry page

 <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/
    comments/#comments"
    data-replace="/comments/{url_title}/">View comments on this
    entry and add your own</a>


 {if segment_4=="comments"}
     <section id="comments" class="focal">
     {embed="inc/.comments" url_title="{url_title}"}
     </section>
 {if:else}
     {comment_loader}
 {/if}
                                              Examples use ExpressionEngine tags
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Source of blog entry page

 <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/
    comments/#comments"
    data-replace="/comments/{url_title}/">View comments on this
    entry and add your own</a>


 {if segment_4=="comments"}
     <section id="comments" class="focal">
     {embed="inc/.comments" url_title="{url_title}"}
     </section>
 {if:else}
     {comment_loader}
 {/if}
                                              Examples use ExpressionEngine tags
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Source of /comments/{url_title} (technically /pages/comments/{url_title})

 {embed="inc/.comments" url_title="{segment_3}"}
                                                          Example uses ExpressionEngine tags
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
                                                                  https://gist.github.com/b976b67e88ffbfc9f125


 $.fn.ajaxInclude = function(){
      return this.each(function() {
           var $el               = $( this ),
                 target          = $el.data( 'target' ),
                 $targetEl       = target && $( target ) || $el,
                 methods         = [ 'append', 'replace', 'before', 'after' ],
                 ml              = methods.length,
                 method,
                 url;
           while ( ml-- ) {
                 method = methods[ ml ];
                 if ( $el.is( '[data-' + method + ']' ) ) {
                       url       = $el.data( method );
                       break;
                 }
           }
           if ( method == 'replace' ) { method += 'With'; }
           if ( url && method ) {
                 $.get( url, function( data ){
                       $el.trigger( 'ajaxInclude', [$targetEl, data] );
                       $targetEl[ method ]( data );
                 });
           }
      });
 };
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
Replace:
 <a data-replace="articles/latest/fragment"
    href="...">Latest Articles</a>


Before:
 <a data-before="articles/latest/fragment"
    href="...">Latest Articles</a>


After:
 <a data-after="articles/latest/fragment"
    href="...">Latest Articles</a>
ADAPTIVE WEB DESIGN WORKSHOP




Anchor-include pattern
 $("[data-append],[data-replace],”+
   “[data-after],[data-before]").ajaxInclude();
JavaScript
             CSS
ADAPTIVE WEB DESIGN WORKSHOP




Remember stuff like this?
 <a href="foo.html"
    style="color:blue;"
    onmouseover="this.style.color='red'"
    onmouseout="this.style.color='blue'">Foo</a>
ADAPTIVE WEB DESIGN WORKSHOP




Remember stuff like this?
 <a href="foo.html"
    style="color:blue;"
    onmouseover="this.style.color='red'"
    onmouseout="this.style.color='blue'">Foo</a>
ADAPTIVE WEB DESIGN WORKSHOP




Remember stuff like this?
 <a href="foo.html"
    style="color:blue;"
    onmouseover="this.style.color='red'"
    onmouseout="this.style.color='blue'">Foo</a>


 a, a:link, a:visited {
   color: blue;
 }
 a:hover {
   color: red;
 }
ADAPTIVE WEB DESIGN WORKSHOP




Isn’t this the same?
 for( i=0; i<objects.length; i++){
   objects[i].style.display = 'none';
 }
ADAPTIVE WEB DESIGN WORKSHOP




Small improvement
 for( i=0; i<objects.length; i++){
   objects[i].style.position = 'absolute';
   objects[i].style.left      = '-999em';
 }
ADAPTIVE WEB DESIGN WORKSHOP




Separation
  for( i=0; i<objects.length; i++){
    objects[i].addClassName( 'hidden' );
  }


  .hidden {
    position: absolute;
    left: -999em;
  }
ADAPTIVE WEB DESIGN WORKSHOP




    Maintenance options
๏   external style rules added to your CSS file (by hand)
๏   external CSS file added to the document (by hand)
๏   external CSS file added to the document via script
๏   embedding CSS in the document via script




                                                            164
ADAPTIVE WEB DESIGN WORKSHOP




Option 1: Add by hand
 /* =START WickedCool Script CSS (do not remove) */
 .wicked {
   color: red;
   font: bold 4em/2 "Comic Sans";
 }
 .cool {
   color: blue;
   font: bold 4em/2 "Comic Sans";
 }
 /* =END WickedCool Script CSS */
ADAPTIVE WEB DESIGN WORKSHOP




Option 2: Include by hand
  <script src="WickedCool.js"></script>
  <link rel="stylesheet" href="WickedCool.css" />
ADAPTIVE WEB DESIGN WORKSHOP




Option 2: Include by hand
  <script src="WickedCool.js"></script>
  <link rel="stylesheet" href="WickedCool.css" />


  <head>
    <!-- … -->
    <link rel="stylesheet" href="WickedCool.css" />
  </head>
  <body>
    <!-- … -->
    <script src="WickedCool.js"></script>
  </body>
ADAPTIVE WEB DESIGN WORKSHOP




Option 3: Scripted include
  function FindPath( filename )
  {
    var path = false;
    var scripts = document.getElementsByTagName( 'script' );
    for( var i=0; i<scripts.length; i++ )
    {
      if( scripts[i].getAttribute( 'src' ) &&
          scripts[i].getAttribute( 'src' )
                    .indexOf( filename ) != -1 )
      {
        path = scripts[i]
                 .getAttribute( 'src' )
                 .replace( new RegExp( filename ), '' );
        break;
      }
    }
    return path;
  }
ADAPTIVE WEB DESIGN WORKSHOP




Option 3: Scripted include
  var WickedCool = {
     jsFile:    'WickedCool.js',
     cssFile:   'WickedCool.css',
     initialize: function(){
       // determine the path
       var path = FindPath( this.jsFile );
       // add the CSS file
       var css = document.createElement( 'link' );
       css.setAttribute( 'rel', 'stylesheet' );
       css.setAttribute( 'href', path + this.cssFile );
       document.getElementsByTagName( 'head' )[0]
               .appendChild( css );
       // do the rest of the wicked cool stuff
     }
  };
ADAPTIVE WEB DESIGN WORKSHOP




Option 4: Scripted embed
  function addCSS( styles )
  {
    var el = document.createElement( 'style' );
         el.setAttribute( 'type', 'text/css' );
    if ( el.styleSheet )
    {
      el.styleSheet.cssText = styles;
    }
    else
    {
      el.appendChild( document.createTextNode( styles ) );
    }
    document.getElementsByTagName( 'head' )[0]
             .appendChild( el );
  }
ADAPTIVE WEB DESIGN WORKSHOP




Option 4: Scripted embed
  var WickedCool = {
     _css: '.wicked { color: red; ' +
           '          font: bold 4em/2 "Comic Sans"; } ' +
           '.cool { color: blue; ' +
           '        font: bold 4em/2' "Comic Sans"; }',
     initialize: function()
     {
       // add the CSS
       addCSS( this._css );
       // do the rest of the wicked cool stuff
     }
  };




                                              based on the work of Nicholas Zakas
Apply No Style
Before Its Time
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




How do we do that?
  .TabInterface-folder {
    /* ... */
  }


  #TabInterface .tab {
    /* ... */
  }
  #TabInterface .tab.active {
    /* ... */
  }




                                172
ADAPTIVE WEB DESIGN WORKSHOP




How do we do that?
               Tactic                Default        Activated


add “-on” to the class         .tabbed         .tabbed-on




add an activation class .auto-submit           .auto-submit.active



change the form of the
                               .replace-me     .replaced
class
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Adaptive UI
ADAPTIVE WEB DESIGN WORKSHOP




Swapping content
 var trigger = 659;

 // …

 function toggleDisplay()
 {
     var width = $window.width();
     if ( showing == 'old' &&
           width <= trigger )
     {
          $old_nav.replaceWith($new_nav);
          showing = 'new';
     }
     else if ( showing == 'new' &&
                width > trigger )
     {
          $new_nav.replaceWith($old_nav);
          showing = 'old';
     }
 }
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Semantics
 <ul>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
ADAPTIVE WEB DESIGN WORKSHOP




Style?
 <ul style=”height: 300px;”>
  <li style=”height: 300px;” >
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li style=”height: 300px;” >
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li style=”height: 300px;” >
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Style?
 <ul class="jcarousel-skin-vr" style=”height: 300px;”>
  <li style=”height: 300px;”>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li style=”height: 300px;”>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li style=”height: 300px;”>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
ADAPTIVE WEB DESIGN WORKSHOP




Script
 <ul id="vr-carousel">
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
      on our progress</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
      National Expansion</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach's innovative approach
      for last mile communities</span>
  </li>
  …
 </ul>
ADAPTIVE WEB DESIGN WORKSHOP




Script
 $j('#vr-carousel').jcarousel({
  auto: 6,
  visible: 1,
  animation: 0,
  wrap: 'both',
  scroll: 1,
  initCallback: vrCarousel_initCallback,
  itemFirstInCallback: vrCarousel_itemFirstInCallback,
  itemFirstInCallback: vrCarousel_fadeIn,
  itemFirstOutCallback: vrCarousel_fadeOut
 });
ADAPTIVE WEB DESIGN WORKSHOP




Script
 function vrCarousel_initCallback( carousel, item, idx, state )
 {
   // Pause autoscrolling if the user moves
   // with the cursor over the clip.
   carousel.clip.hover(function() {
       carousel.stopAuto();
   }, function() {
       carousel.startAuto();
   });

  $j('.jcarousel-item').css('opacity', 0);
 };
ADAPTIVE WEB DESIGN WORKSHOP




Script
 function vrCarousel_initCallback( carousel, item, idx, state )
 {
   var $i = carousel.list.find(‘img’), h = 0;

    // get the max h
    $i.each(function(){
     var test = $j(this).height();
     if ( test > h ){ h = test; }
    });

    // …

    carousel.list.height(h);
    $j('.jcarousel-item').css({
     opacity: 0, height: h
    });

 };
http://flex.madebymufffin.com
User Experience




                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
User Experience



                     Accessibility

                     Interactivity

                         Design

                      Semantics
             BASIC                          ADVANCED

                     Browser Capabilities


                        Content
Accessibility
“special needs”
“special needs”
    can be
 CONTEXTUAL
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Tweet</button>

 <a class=”button”>Tweet</a>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Tweet</button>

 <a class=”button”>Tweet</a>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Search Mail</button>

 <div>Search Mail</div>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <button>Search Mail</button>

 <div>Search Mail</div>
ADAPTIVE WEB DESIGN WORKSHOP




ARIA maps the OS to the web
Semantics+
ADAPTIVE WEB DESIGN WORKSHOP




All the web’s a play…
 <section id="main" role="main">
  <!-- The primary content for the page would go here -->
 </section>
Adaptive Web Design [WebVisions Portland 2012]
<header role="banner">
<nav role="navigation">
<form role="search">
<section role="main">
ADAPTIVE WEB DESIGN WORKSHOP




Semantic comparison
             Ad-hoc                   ARIA Role               HTML5

 #header, #top                 banner                header (kind of)


 #main, #content               main                  none


 #extra, .sidebar              complementary, note   aside


 #footer, #bottom              contentinfo           footer


 #nav                          navigation            nav


 .hentry                       article               article
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




These are the droids you seek
 <span role="button">OK</span>


 <div role="alert">
  <p>Something went wrong.</p>
 </div>


 <div role="alertdialog">
  <p>Something went wrong.</p>
  <img src="x.png" alt="dismiss" role="button" />
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <a role=”button”>Tweet</a>
    class=”button”>Tweet</a>
ADAPTIVE WEB DESIGN WORKSHOP




What is it?




 <a role=”button”>Tweet</a>
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




What’s happening?

                               B       B
                               (off)   (on)




 <span>
  <img src="bold-off.png" alt="bold" />
 </span>
 <span>
  <img src="bold-on.png" alt="bold" />
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




What’s happening?

                               B       B
                               (off)   (on)




 <span>
  <img src="bold-off.png" alt="not bold" />
 </span>
 <span>
  <img src="bold-on.png" alt="bold" />
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




What’s happening?

                               B       B
                               (off)   (on)




 <span role="button" aria-pressed="false">
  <img src="bold-off.png" alt="not bold" />
 </span>
 <span role="button" aria-pressed="true">
  <img src="bold-on.png" alt="bold" />
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




Complex interfaces
ADAPTIVE WEB DESIGN WORKSHOP




Traditional approach
 <h1>Pumpkin Pie</h1>
 <div class="container">
  <div class="section">
    <h2>Overview</h2>
    <img src="pie.jpg" alt="">
    <p>Whether you're hosting a festive party or a casual
    get-together with friends, our Pumpkin Pie will make
    entertaining easy!</p>
    <!-- ... -->
  </div>
  <!-- ... -->
  <ul class="tabs">
    <li><a href="#">Overview</a></li>
    <li><a href="#">Ingredients</a></li>
    <li><a href="#">Directions</a></li>
    <li><a href="#">Nutrition</a></li>
  </ul>
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




Cleaner approach
 <h1>Pumpkin Pie</h1>
 <div class="tabbed">
  <h2>Overview</h2>
  <img src="pie.jpg" alt="" />
  <p>Whether you're hosting a festive party or a casual
  get-together with friends, our Pumpkin Pie will make
  entertaining easy!</p>
  <!-- ... -->
  <h2>Ingredients</h2>
  <ul>
    <li>1 (9<abbr title="inch">in</abbr>) unbaked deep
       dish pie crust</li>
    <li>½ cup white sugar</li>
    <!-- ... -->
  </ul>
  <h2>Directions</h2>
  <!-- ... -->
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




Cleaner approach
 <h1>Pumpkin Pie</h1>
 <div class="tabbed">
  <h2>Overview</h2>
  <img src="pie.jpg" alt="" />
  <p>Whether you're hosting a festive party or a casual
  get-together with friends, our Pumpkin Pie will make
  entertaining easy!</p>
  <!-- ... -->
  <h2>Ingredients</h2>
  <ul>
    <li>1 (9<abbr title="inch">in</abbr>) unbaked deep
       dish pie crust</li>
    <li>½ cup white sugar</li>
    <!-- ... -->
  </ul>
  <h2>Directions</h2>
  <!-- ... -->
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




No JS, basic CSS
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic


                               Page
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic


                               Page




                               JS?
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic


                               Page




                               JS?    No
ADAPTIVE WEB DESIGN WORKSHOP




Widget logic



               Split                 Page
          the content &
           make some
               tabs


                                     JS?
                               Yes          No
ADAPTIVE WEB DESIGN WORKSHOP




On DOM ready
 <h1>Pumpkin Pie</h1>
 <div class="tabbed-on">
  <section>
    <h2>Overview</h2>
    <img src="pie.jpg" alt="">
    <p>Whether you're hosting a festive party or a casual
    get-together with friends, our Pumpkin Pie will make
    entertaining easy!</p>
    <!-- ... -->
  </section>
  <!-- ... -->
  <ul class="tabs">
    <li><a href="#">Overview</a></li>
    <li><a href="#">Ingredients</a></li>
    <li><a href="#">Directions</a></li>
    <li><a href="#">Nutrition</a></li>
  </ul>
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA
                               role="tablist"




                                                223
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA




               role="tab"
               aria-selected="true"
               aria-controls="folder-1"
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA                    role="tab"
                               aria-selected="false"
                               aria-controls="folder-4"
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA




                               role="tabpanel"
                               aria-hidden="false"
                               aria-labelledby="folder-1-tab"
ADAPTIVE WEB DESIGN WORKSHOP




Adding ARIA




                               role="application"
                               aria-activedescendant="folder-1"
ADAPTIVE WEB DESIGN WORKSHOP




Result!
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <input class="tweet-counter" value="140" disabled="disabled">
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span id="chars_left_notice" class="numeric">
  <strong id="status-field-char-counter"
        class="char-counter">140</strong>
 </span>
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span class="tweet-counter">140
  <b class="hidden"> characters remaining</b></span>


 .hidden {
   position: absolute;
   left: −999em;
 }
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span class="tweet-counter">maximum of 140 characters</span>



 <span class="tweet-counter">140
  <b class="hidden"> characters remaining</b></span>
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!




 <span aria-live="polite" aria-atomic="true"
       class="tweet-counter">140<b class="hidden">
       characters remaining</b></span>
ADAPTIVE WEB DESIGN WORKSHOP




Hey! Over here!
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                               Accessibility
 CSS Rules                     Display Effect
                                                               Effect
 visibility: hidden;           Element is hidden from          Content is ignored by screen
                               view, but is not removed        readers
                               from the normal flow (i.e. it
                               still takes up the space it
                               normally would)

 display: none;                Element is removed from         Content is ignored by screen
                               the normal flow and hidden;     readers
                               the space it occupied is
                               collapsed

 height: 0;                    Element is collapsed and        Content is ignored by screen
 width: 0;                     contents are hidden             readers
 overflow: hidden;
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                             Accessibility
 CSS Rules                     Display Effect
                                                             Effect
 text-indent: -999em;          Contents are shifted off-     Screen readers have access
                               screen and hidden from        to the content, but the
                               view, but links may “focus”   content is limited to text and
                               oddly and negative indent     inline elements
                               may not prove long enough
                               to fully hide content


 position: absolute;           Content is removed from       Screen readers have access
 left: -999em;                 the normal flow and shifted   to the content
                               off the left-hand edge; the
                               space it occupied is
                               collapsed
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                             Accessibility
 CSS Rules                     Display Effect
                                                             Effect
 position: absolute;           Content is positioned         Screen readers have access
 /* IE6, IE7 */                absolutely (and is removed    to the content
 clip: rect(
   1px 1px 1px 1px             from the normal flow), but
       );                      remains in place and is
 /* W3C */                     clipped to become invisible
 clip: rect(
   1px, 1px, 1px, 1px
       );
 padding: 0;
 border: 0;
 height: 1px;
 width: 1px;
 overflow: hidden;
ADAPTIVE WEB DESIGN WORKSHOP




Typical hiding schemes
                                                               Accessibility
 CSS Rules                     Display Effect
                                                               Effect
 visibility: hidden;           Element is hidden from          Content is ignored by screen
                               view, but is not removed        readers
                               from the normal flow (i.e. it
                               still takes up the space it
                               normally would)

 display: none;                Element is removed from         Content is ignored by screen
                               the normal flow and hidden;     readers
                               the space it occupied is
                               collapsed

 height: 0;                    Element is collapsed and        Content is ignored by screen
 width: 0;                     contents are hidden             readers
 overflow: hidden;
ADAPTIVE WEB DESIGN WORKSHOP




“Fixing” libraries
 (function(){
   var $button = $('#myButton'),
       $text = $('#myText'),
       visible = true;
   $button.click(function(){
    if ( visible ) {
      $text.slideUp('fast');
    } else {
      $text.slideDown('fast');
    }
    visible = ! visible;
   });
 })();
ADAPTIVE WEB DESIGN WORKSHOP




“Fixing” libraries
 (function(){
   var $button = $('#myButton'),
       $text = $('#myText'),
       visible = true;
   $button.click(function(){
    if ( visible ) {
      $text.slideUp('fast',function(){
         $text.addClass('accessibly-hidden')
             .slideDown(0);
       });
    } else {
      $text.slideUp(0,function(){
         $text.removeClass('accessibly-hidden')
             .slideDown('fast');
       });
    }
    visible = ! visible;
   });
 })();
ADAPTIVE WEB DESIGN WORKSHOP




Managing focus
 <div tabindex="0">
  <p>This <code>div</code> can now receive focus using a
 keyboard’s <kbd>tab</kbd> key. How cool is that?</p>
 </div>

 <div tabindex="-1">
  <p>This <code>div</code> won’t be focused by a user via the
 <kbd>tab</kbd> key, but JavaScript can <code>focus()</code> it.
 Nifty, huh?</p>
 </div>
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Header
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="header">
  <a href="#donate" class="donate-link"
     title="Click here to view our donation options">Donate</a>
  <a href="http://villagereach.org/feed/" class="rss-link"
     title="View our RSS Feed">RSS Feed</a>
  <div id="site-title">
    <a href="http://villagereach.org" title="Village Reach: Home">
     <span>Village Reach</span>
    </a>
  </div>
 </div><!-- #header -->
Adaptive Web Design [WebVisions Portland 2012]
Features




Programs




 News
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div class="entry-content entry">
  <!-- Features -->
  <div class="boxes three home">
    <!-- Programs -->
  </div>
  <div id="latestNews">
    <!-- Latest News -->
  </div>
 </div>
Adaptive Web Design [WebVisions Portland 2012]
Nav
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="hybrid-search-3" class="widget search widget-search">
  <div class="widget-inside">
    <form method="get" class="search-form" id="search-form"
 action="http://villagereach.org/">
      <!--Search Form -->
    </form><!-- .search-form -->
  </div>
 </div>
 <div id="navigation">
  <div id="page-nav" class="page-nav">
    <ul class="menu sf-menu">
      <!-- Navigation -->
    </ul>
  </div>
 </div><!-- #navigation -->
Adaptive Web Design [WebVisions Portland 2012]
Extra

   Social


Newsletter
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="text-8" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Extra -->
  </div>
 </div>
 <div id="text-7" class="widget widget_text widget-widget_text">
  <div class="widget-inside">
    <!-- Social -->
  </div>
 </div>
 <div id="mc_signup_container">
  <!-- Newsletter -->
 </div>
Adaptive Web Design [WebVisions Portland 2012]
Footer
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles
 <div id="footer-container">
  <div id="footer">
    <p class="copyright">Copyright &#169; 2011 <a class="site-link"
 href="http://villagereach.org" title="VillageReach"
 rel="home"><span>VillageReach</span></a>. - All rights
 reserved.</p>
  </div><!-- #footer -->
 </div><!-- #footer-container -->
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
Adaptive Web Design [WebVisions Portland 2012]
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles & States
 <div class="jcarousel-container jcarousel-container-horizontal"
      style="display: block; ">
  <ul id="vr-carousel">
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>Your new online source for information
     on our progress</span>
  </li>
  <li>
    <a href="#"><img src="…" alt="" /></a>
    <span>VillageReach Announces Mozambique
     National Expansion</span>
  </li>
  …
  </ul>
 </div>
ADAPTIVE WEB DESIGN WORKSHOP




ARIA Roles & States
 <div id="jcarousel-control">
  <div class="jcarousel-prev jcarousel-prev-horizontal"
        style="display: block; " disabled="false"></div>
  <span id="jcarousel-control-caption">
    VillageReach Announces Mozambique National Expansion
  </span>
  <div class="jcarousel-next jcarousel-next-horizontal"
        style="display: block; " disabled="false"></div>
 </div>
Adaptive Web Design
    Workshop
          by Aaron Gustafson



            More of the same:
     http://adaptivewebdesign.info
         http://easy-designs.net
      http://blog.easy-designs.net
      http://aaron-gustafson.com



             Slides available at
  http://slideshare.net/AaronGustafson



 © Aaron Gustafson. All Rights Reserved.

More Related Content

PDF
Adaptive Web Design Workshop [inspire 2011]
PDF
Adaptive Web Design Workshop [WebVisions NYC 2012]
PDF
Adaptive Web Design Workshop [Iceweb 2011]
PDF
Optimizing HTML5 Sites with CQ5/WEM
PDF
HTML5 Technical Executive Summary
PDF
PDF
Emakina Academy - 5 - Know your audience - Web Analytics
PDF
What's new in Portal and WCM 8.5
Adaptive Web Design Workshop [inspire 2011]
Adaptive Web Design Workshop [WebVisions NYC 2012]
Adaptive Web Design Workshop [Iceweb 2011]
Optimizing HTML5 Sites with CQ5/WEM
HTML5 Technical Executive Summary
Emakina Academy - 5 - Know your audience - Web Analytics
What's new in Portal and WCM 8.5

What's hot (20)

PDF
4Ward Company Presentation
PDF
Managing Content In Portal Wcm
DOC
Alexander Zeng
PPT
IBM Portal Web intro
PPT
WebSphere Portal Business Overview
PDF
HTML5 and the dawn of rich mobile web applications
PPT
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
PPTX
Station Four: Web Redesign Presentation
PDF
RadPHP XE Datasheet
PDF
Website Development Process
PDF
IT Project NE - Services Offer 2013
PPTX
Web Sphere Portal
PDF
JavaOne 2010 Keynote
PDF
Websphere Portal
PPT
IBM WebSphere Portal
PDF
Cmis Virtual Training Webinar 24 Nov09
PDF
Web, Mobile, App and Back!
PDF
The History and Status of Web Crypto API (2012)
PDF
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
PPT
WebSphere Portal Technical Overview
4Ward Company Presentation
Managing Content In Portal Wcm
Alexander Zeng
IBM Portal Web intro
WebSphere Portal Business Overview
HTML5 and the dawn of rich mobile web applications
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Station Four: Web Redesign Presentation
RadPHP XE Datasheet
Website Development Process
IT Project NE - Services Offer 2013
Web Sphere Portal
JavaOne 2010 Keynote
Websphere Portal
IBM WebSphere Portal
Cmis Virtual Training Webinar 24 Nov09
Web, Mobile, App and Back!
The History and Status of Web Crypto API (2012)
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
WebSphere Portal Technical Overview
Ad

Similar to Adaptive Web Design [WebVisions Portland 2012] (20)

PDF
HTML5 & CSS3 Workshop [FoWD NYC 2011]
PDF
Crafting Rich Experiences with Progressive Enhancement [WebVisions 2011]
KEY
WHAT IS HTML5?(20100510)
KEY
WHAT IS HTML5? (at CSS Nite Osaka)
PDF
WordCamp Thessaloniki2011 The NextWeb
PDF
Word camp nextweb
PDF
Progressive EEnhancement [EECI 2011]
PDF
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
PDF
Crafting Rich Experiences with Progressive Enhancement [Beyond Tellerrand 2011]
PDF
What is HTML5
PDF
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
PPTX
Intro to modern web technology
KEY
Dojo & HTML5
PDF
qooxdoo - Open Source Ajax Framework
PDF
Progressive Enhancement & Mobile [Funka 2012]
PDF
Share Point, The Right CMS For Your Website?
PPTX
web designing course bangalore
PDF
No Feature Solutions with SharePoint
KEY
Editor kiss
HTML5 & CSS3 Workshop [FoWD NYC 2011]
Crafting Rich Experiences with Progressive Enhancement [WebVisions 2011]
WHAT IS HTML5?(20100510)
WHAT IS HTML5? (at CSS Nite Osaka)
WordCamp Thessaloniki2011 The NextWeb
Word camp nextweb
Progressive EEnhancement [EECI 2011]
HTML Hypermedia APIs and Adaptive Web Design - Nordic APIs
Crafting Rich Experiences with Progressive Enhancement [Beyond Tellerrand 2011]
What is HTML5
HTML5 Smart Markup for Smarter Websites [FoWD NYC 2011]
Intro to modern web technology
Dojo & HTML5
qooxdoo - Open Source Ajax Framework
Progressive Enhancement & Mobile [Funka 2012]
Share Point, The Right CMS For Your Website?
web designing course bangalore
No Feature Solutions with SharePoint
Editor kiss
Ad

More from Aaron Gustafson (20)

PDF
Delivering Critical Information and Services [JavaScript & Friends 2021]
PDF
Adapting to Reality [Guest Lecture, March 2021]
PDF
Designing the Conversation [Beyond Tellerrand 2019]
PPTX
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
PDF
Progressive Web Apps: Where Do I Begin?
PDF
Media in the Age of PWAs [ImageCon 2019]
PDF
Adapting to Reality [Starbucks Lunch & Learn]
PDF
Conversational Semantics for the Web [CascadiaJS 2018]
PDF
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
PDF
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PDF
Designing the Conversation [Concatenate 2018]
PDF
Designing the Conversation [Accessibility DC 2018]
PDF
Performance as User Experience [AEADC 2018]
PDF
The Web Should Just Work for Everyone
PDF
Performance as User Experience [AEA SEA 2018]
PDF
Performance as User Experience [An Event Apart Denver 2017]
PDF
Advanced Design Methods 1, Day 2
PDF
Advanced Design Methods 1, Day 1
PDF
Designing the Conversation [Paris Web 2017]
PDF
Exploring Adaptive Interfaces [Generate 2017]
Delivering Critical Information and Services [JavaScript & Friends 2021]
Adapting to Reality [Guest Lecture, March 2021]
Designing the Conversation [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Progressive Web Apps: Where Do I Begin?
Media in the Age of PWAs [ImageCon 2019]
Adapting to Reality [Starbucks Lunch & Learn]
Conversational Semantics for the Web [CascadiaJS 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Accessibility DC 2018]
Performance as User Experience [AEADC 2018]
The Web Should Just Work for Everyone
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [An Event Apart Denver 2017]
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 1
Designing the Conversation [Paris Web 2017]
Exploring Adaptive Interfaces [Generate 2017]

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Tartificialntelligence_presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
MIND Revenue Release Quarter 2 2025 Press Release
Tartificialntelligence_presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
SOPHOS-XG Firewall Administrator PPT.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MYSQL Presentation for SQL database connectivity
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
Programs and apps: productivity, graphics, security and other tools
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Adaptive Web Design [WebVisions Portland 2012]

  • 1. ADAPTIVE WEB DESIGN WORKSHOP The Agenda ๏ Progressive Enhancement ‣ vs Graceful Degradation ‣ How & Why It Works ๏ Content & Organization ๏ Semantics ‣ HTML5 ‣ Microformats 2
  • 2. ADAPTIVE WEB DESIGN WORKSHOP The Agenda ๏ Design ‣ Parsing Errors ‣ Designing in Layers ‣ Adaptive (& Responsive) Layouts ‣ “Mobile First” ๏ Interactivity ‣ Unobtrusive JavaScript ‣ Adaptive Interfaces ‣ Hijax 3
  • 3. ADAPTIVE WEB DESIGN WORKSHOP The Agenda ๏ Accessibility ‣ Design Considerations ‣ ARIA 4
  • 6. ?
  • 14. HTML CSS
  • 15. fault tolerance n. a system’s ability to continue to operate when it encounters and unexpected error.
  • 19. Browsers IGNORE what they don’t understand
  • 20. I like an escalator because an escalator can never break, it can only become stairs. — Mitch Hedberg
  • 22. Modern Browsers Older Browsers
  • 23. Modern Browsers Older Browsers
  • 33. Don’t lose sight of your USERS
  • 34. User Experience BASIC ADVANCED Browser Capabilities
  • 35. User Experience BASIC ADVANCED Browser Capabilities Content
  • 36. User Experience Semantics BASIC ADVANCED Browser Capabilities Content
  • 37. User Experience Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 38. User Experience Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 39. User Experience Accessibility Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 40. User Experience ARIA JavaScript CSS HTML BASIC ADVANCED Browser Capabilities Text & HTTP
  • 41. HTML
  • 43. User Experience BASIC ADVANCED Browser Capabilities Content
  • 44. Content is WHY we build websites
  • 50. Header Nav Features Extra Social Programs Newsletter News Footer
  • 51. Header Features Nav Programs Extra News Social Newsletter Footer
  • 52. User Experience BASIC ADVANCED Browser Capabilities Content
  • 53. User Experience Semantics BASIC ADVANCED Browser Capabilities Content
  • 55. ADAPTIVE WEB DESIGN WORKSHOP Semantics 101 <p>HTML5 introduces several <em>really</em> useful elements and a ton of new APIs.</p> <p>Please fill out the form below. <strong>Note: all fields are required.</strong></p> <p>I like to work with markup languages because <strong>they are simple and easy to read</strong>. They also have that certain <i lang="fr" title="I don&#8217;t know what">je ne sais quoi</i>.</p>
  • 56. ADAPTIVE WEB DESIGN WORKSHOP Semantics 101 small
  • 57. ADAPTIVE WEB DESIGN WORKSHOP Semantics 101 hr
  • 61. ADAPTIVE WEB DESIGN WORKSHOP Organization <figure id="fig-1"> <img src="photo.jpeg" alt=""/> <figcaption>Photo of Albert Einstein</figcaption> </figure> <figure id="fig-2"> <table> <caption>2011 Forecast Earnings</caption> <!-- a bunch of data --> </table> </figure>
  • 62. ADAPTIVE WEB DESIGN WORKSHOP Organization <section> <!-- pretty much anything can go here --> </section> <article> <!-- pretty much anything can go here --> </article>
  • 67. ADAPTIVE WEB DESIGN WORKSHOP Organization <header> <!-- titles, etc. go here --> </header> <footer> <!-- meta/supplementary information goes here --> </footer>
  • 74. ADAPTIVE WEB DESIGN WORKSHOP Organization <nav> <ol> <li><a href="#details">Details</a></li> <li><a href="#lodging">Lodging</a></li> <li><a href="#location">Location</a></li> <li><a href="#topics">Topics</a></li> <li><a href="#contact">Contact Us</a></li> </ol> <p><a href="register">Register Now</a> <b>Only 5 spaces left</b></p> </nav>
  • 75. nav
  • 76. nav
  • 78. ADAPTIVE WEB DESIGN WORKSHOP Implicit sections (HTML4) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h2> W3C standardization process <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h2> Markup <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 79. ADAPTIVE WEB DESIGN WORKSHOP Explicit sections (HTML5) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h2> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h2> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 80. ADAPTIVE WEB DESIGN WORKSHOP Explicit sections (HTML5) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h1> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h1> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 81. ADAPTIVE WEB DESIGN WORKSHOP Explicit sections (HTML5) <h1> HTML5 <p> HTML5 is currently under development... <p> Like its immediate predecessors, HTML... <h4> W3C standardization process section <p> The Web Hypertext Application... <p> The HTML5 specification... <p> According to the W3C timetable... <p> Ian Hickson, editor of the HTML5... <h6> Markup section <p> HTML5 introduces a number of... <p> The HTML5 syntax is no longer... 1 HTML5 1.1 W3C standardization process 1.2 Markup
  • 82. ADAPTIVE WEB DESIGN WORKSHOP Sections ๏ section ๏ article ๏ aside ๏ nav 81
  • 83. ADAPTIVE WEB DESIGN WORKSHOP Outline limitations in HTML4 <h1> Title <h2> Subtitle <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title 1.1 Subtitle
  • 84. ADAPTIVE WEB DESIGN WORKSHOP Heading groups (HTML5) hgroup <h1> Title <h2> Subtitle <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title
  • 85. ADAPTIVE WEB DESIGN WORKSHOP Aside: rooted sections <h1> Title <p> Text content continues... <p> Text content continues... <h2> Section heading <p> Text content continues... <blockquote> <h2> Rooted heading <p> Text content continues... <p> Text content continues... <p> Text content continues... <p> Text content continues... 1 Title 1.1 Section heading
  • 86. ADAPTIVE WEB DESIGN WORKSHOP Sectioning roots ๏ body ๏ blockquote ๏ details ๏ fieldset ๏ figure ๏ td 85
  • 88. ADAPTIVE WEB DESIGN WORKSHOP Dates & Times <input type="date" name="dob"/>
  • 89. ADAPTIVE WEB DESIGN WORKSHOP Numbers <input type="number" name="foo"/> <input type="range" min="1" max="11" name="foo"/>
  • 90. ADAPTIVE WEB DESIGN WORKSHOP Format validation <input type="email" …/> <input type="url" …/>
  • 91. ADAPTIVE WEB DESIGN WORKSHOP Format validation <input type="text" pattern="d{6}w{3}" placeholder="6 digits followed by 3 letters" .../>
  • 93. ADAPTIVE WEB DESIGN WORKSHOP Classification
  • 94. ADAPTIVE WEB DESIGN WORKSHOP Identification
  • 95. ADAPTIVE WEB DESIGN WORKSHOP Microformats <section class="vcard"> <figure> <img class="photo" src="aaron-gustafson.jpg" alt=""/> </figure> <h1 class="fn">Aaron Gustafson</h1> … <p>Aaron … is <b class="role">Group Manager</b> of the <a class="org" href="http://webstandards.org">Web Standards Project (WaSP)</a> ….</p> </section>
  • 101. Header
  • 102. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="header"> <a href="#donate" class="donate-link" title="Click here to view our donation options">Donate</a> <a href="http://villagereach.org/feed/" class="rss-link" title="View our RSS Feed">RSS Feed</a> <div id="site-title"> <a href="http://villagereach.org" title="Village Reach: Home"> <span>Village Reach</span> </a> </div> </div><!-- #header -->
  • 105. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div class="entry-content entry"> <!-- Features --> <div class="boxes three home"> <!-- Programs --> </div> <div id="latestNews"> <!-- Latest News --> </div> </div>
  • 107. Nav
  • 108. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="hybrid-search-3" class="widget search widget-search"> <div class="widget-inside"> <form method="get" class="search-form" id="search-form" action="http://villagereach.org/"> <!--Search Form --> </form><!-- .search-form --> </div> </div> <div id="navigation"> <div id="page-nav" class="page-nav"> <ul class="menu sf-menu"> <!-- Navigation --> </ul> </div> </div><!-- #navigation -->
  • 110. Extra Social Newsletter
  • 111. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="text-8" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Extra --> </div> </div> <div id="text-7" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Social --> </div> </div> <div id="mc_signup_container"> <!-- Newsletter --> </div>
  • 113. Footer
  • 114. ADAPTIVE WEB DESIGN WORKSHOP Semantics <div id="footer-container"> <div id="footer"> <p class="copyright">Copyright &#169; 2011 <a class="site-link" href="http://villagereach.org" title="VillageReach" rel="home"><span>VillageReach</span></a>. - All rights reserved.</p> </div><!-- #footer --> </div><!-- #footer-container -->
  • 115. User Experience Semantics BASIC ADVANCED Browser Capabilities Content
  • 116. User Experience Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 117. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p{ color: red; }
  • 118. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p{ color: red; font-weight: bold; }
  • 119. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors p { color: #ccc; color: rgba( 0, 0, 0, .5 ); }
  • 120. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors html[lang] p { color: #ccc; color: rgba( 0, 0, 0, .5 ); }
  • 121. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors @-moz-document url-prefix() { html[lang] p { color: #ccc; color: rgba( 0, 0, 0, .5 ); } }
  • 122. #intro { /* Basic Layout */ } /* ... */ body[id=css-zen-garden] #intro { /* Advanced Layout */ }
  • 123. #intro { /* Basic Layout */ } /* ... */ [foo], #intro { /* Advanced Layout */ }
  • 124. ADAPTIVE WEB DESIGN WORKSHOP Parsing errors @import 'not-for-IE7-or-below.css' screen; @media screen, print, refrigerator { /* IE will get these rules */ }
  • 125. ADAPTIVE WEB DESIGN WORKSHOP Organization design
  • 126. ADAPTIVE WEB DESIGN WORKSHOP Organization type color layout
  • 127. ADAPTIVE WEB DESIGN WORKSHOP Organization /* =Typography */ img { display: block; } /* =Layout */ @media screen { .frame .inner { border: 10px solid; } } /* =Color */ .frame .inner { background-color: rgb(227, 222, 215); border-color: rgb(227, 222, 215); }
  • 128. ADAPTIVE WEB DESIGN WORKSHOP Organization type.css layout.css main.css color.css
  • 129. ADAPTIVE WEB DESIGN WORKSHOP Organization {embed="styles/typography"} @media screen {   {embed="styles/layout-screen"} } {embed="styles/color"} Example using ExpressionEngine embed tags
  • 130. ADAPTIVE WEB DESIGN WORKSHOP Organization {embed="styles/reset"} {embed="styles/typography"} @media screen {   {embed="styles/layout-screen"} } @media print {   {embed="styles/layout-print"} } {embed="styles/color"} {embed="styles/effects"} Example using ExpressionEngine embed tags
  • 131. ADAPTIVE WEB DESIGN WORKSHOP Monkey-patching <link rel="stylesheet" href="main.css"/> <!--[if IE 9]><link rel="stylesheet" href="ie9.css"/><![endif]--> <!--[if lte IE 8]><link rel="stylesheet" href="ie8.css"/><![endif]--> <!--[if lte IE 7]><link rel="stylesheet" href="ie7.css"/><![endif]--> <!--[if lte IE 6]><link rel="stylesheet" href="ie6.css"/><![endif]-->
  • 132. ADAPTIVE WEB DESIGN WORKSHOP Monkey-patching @-moz-document url-prefix() { /* GENERATED CONTENT - FF3 doesn't allow positioning */ #extra-mile:before { content: ''; } #extra-mile:first-of-type:before { content: url(extra-mile-sign.png); } }
  • 134. PROGRESSIVE ENHANCEMENT & MOBILE @Media blocks @media screen { /* Styles for screen media only */ }
  • 135. PROGRESSIVE ENHANCEMENT & MOBILE @Media blocks+ @media screen and (max-width:450px) { /* Styles for screen media when browser is 450px wide or below */ }
  • 136. PROGRESSIVE ENHANCEMENT & MOBILE Don’t do this @media screen and (min-device-width:1024px) and (max-width:989px), screen and (max-device-width:480px), screen and (max-device-width:480px) and (orientation:landscape), screen and (min-device-width:481px) and (orientation:portrait) { /* Layout for narrower desktop (below 990px) or iPhone running iOS 3 (or equivalent) or iPhone running iOS 4 (or equivalent) in “landscape” view or iPad (or equivalent) in “portrait” view */ }
  • 137. PROGRESSIVE ENHANCEMENT & MOBILE Mobile First w/ media queries /* Universal Layout */ @media screen { /* Styles for all screens */ } @media screen and (min-width:481px) { /* Styles for all screens 480px+ width */ } @media screen and (min-width:754px) { /* Styles for all screens 754px+ width */ }
  • 142. PROGRESSIVE ENHANCEMENT & MOBILE Mobile First w/ media queries #hd { background: url(hd-bg-small.png) repeat-x 50% 50%; } #hd .logo a { background: url(logo-small.png) no-repeat 50% 0; display: block; width: 240px; height: 109px; /* … */ } @media screen and (min-width: 481px) { #hd { background: url(hd-bg.png) no-repeat 50% 52px; } #hd .logo a { background-image: url(logo.png); width: 342px; height: 155px; } }
  • 143. Header Nav Features Extra Social Programs Newsletter News Footer
  • 145. Header Nav Features Extra Social Programs Newsletter News Footer
  • 146. User Experience Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 147. User Experience Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 149. ADAPTIVE WEB DESIGN WORKSHOP Sins of our past <a href="javascript:someFunction();">some text</a> <a href="javascript:void(null);" onclick="someFunction();">some text</a> <a href="#" onclick="someFunction();">some text</a>
  • 150. ADAPTIVE WEB DESIGN WORKSHOP A minor improvement <a href="http://offsite.com" onclick="newWin( this.href ); return false;"> some text</a>
  • 152. ADAPTIVE WEB DESIGN WORKSHOP Event listeners window.onload = handleExternalLinks; function handleExternalLinks() { var server = document.location.hostname; var anchors = document.getElementsByTagName("a"); var i, href; for( i=0; i < anchors.length; i++ ) { href = anchors[i].href; if ( href.indexOf("http://" + server) == -1 && href.indexOf("https://" + server) == -1 ) { // HREF is not a file on my server anchors[i].onclick = function() { newWin( this.href ); }; } } }
  • 154. ADAPTIVE WEB DESIGN WORKSHOP Listen and delegate document .getElementsByTagName( 'body' )[0] .onclick = clickDelegator; function clickDelegator( e ) { e = ( e ) ? e : event; var el = e.target || e.srcElement; // external links if ( el.nodeName.toLowerCase() == 'a' && el.getAttribute( 'rel' ) == 'external' ) { newWin( el.href ); } }
  • 166. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Source of blog entry page <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/ comments/#comments" data-replace="/comments/{url_title}/">View comments on this entry and add your own</a> {if segment_4=="comments"} <section id="comments" class="focal"> {embed="inc/.comments" url_title="{url_title}"} </section> {if:else} {comment_loader} {/if} Examples use ExpressionEngine tags
  • 167. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Source of blog entry page <a href="/archives/{entry_date format='%Y/%m/%d'}/{url_title}/ comments/#comments" data-replace="/comments/{url_title}/">View comments on this entry and add your own</a> {if segment_4=="comments"} <section id="comments" class="focal"> {embed="inc/.comments" url_title="{url_title}"} </section> {if:else} {comment_loader} {/if} Examples use ExpressionEngine tags
  • 168. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Source of /comments/{url_title} (technically /pages/comments/{url_title}) {embed="inc/.comments" url_title="{segment_3}"} Example uses ExpressionEngine tags
  • 169. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern https://gist.github.com/b976b67e88ffbfc9f125 $.fn.ajaxInclude = function(){ return this.each(function() { var $el = $( this ), target = $el.data( 'target' ), $targetEl = target && $( target ) || $el, methods = [ 'append', 'replace', 'before', 'after' ], ml = methods.length, method, url; while ( ml-- ) { method = methods[ ml ]; if ( $el.is( '[data-' + method + ']' ) ) { url = $el.data( method ); break; } } if ( method == 'replace' ) { method += 'With'; } if ( url && method ) { $.get( url, function( data ){ $el.trigger( 'ajaxInclude', [$targetEl, data] ); $targetEl[ method ]( data ); }); } }); };
  • 170. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern Replace: <a data-replace="articles/latest/fragment" href="...">Latest Articles</a> Before: <a data-before="articles/latest/fragment" href="...">Latest Articles</a> After: <a data-after="articles/latest/fragment" href="...">Latest Articles</a>
  • 171. ADAPTIVE WEB DESIGN WORKSHOP Anchor-include pattern $("[data-append],[data-replace],”+ “[data-after],[data-before]").ajaxInclude();
  • 172. JavaScript CSS
  • 173. ADAPTIVE WEB DESIGN WORKSHOP Remember stuff like this? <a href="foo.html" style="color:blue;" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'">Foo</a>
  • 174. ADAPTIVE WEB DESIGN WORKSHOP Remember stuff like this? <a href="foo.html" style="color:blue;" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'">Foo</a>
  • 175. ADAPTIVE WEB DESIGN WORKSHOP Remember stuff like this? <a href="foo.html" style="color:blue;" onmouseover="this.style.color='red'" onmouseout="this.style.color='blue'">Foo</a> a, a:link, a:visited { color: blue; } a:hover { color: red; }
  • 176. ADAPTIVE WEB DESIGN WORKSHOP Isn’t this the same? for( i=0; i<objects.length; i++){ objects[i].style.display = 'none'; }
  • 177. ADAPTIVE WEB DESIGN WORKSHOP Small improvement for( i=0; i<objects.length; i++){ objects[i].style.position = 'absolute'; objects[i].style.left = '-999em'; }
  • 178. ADAPTIVE WEB DESIGN WORKSHOP Separation for( i=0; i<objects.length; i++){ objects[i].addClassName( 'hidden' ); } .hidden { position: absolute; left: -999em; }
  • 179. ADAPTIVE WEB DESIGN WORKSHOP Maintenance options ๏ external style rules added to your CSS file (by hand) ๏ external CSS file added to the document (by hand) ๏ external CSS file added to the document via script ๏ embedding CSS in the document via script 164
  • 180. ADAPTIVE WEB DESIGN WORKSHOP Option 1: Add by hand /* =START WickedCool Script CSS (do not remove) */ .wicked { color: red; font: bold 4em/2 "Comic Sans"; } .cool { color: blue; font: bold 4em/2 "Comic Sans"; } /* =END WickedCool Script CSS */
  • 181. ADAPTIVE WEB DESIGN WORKSHOP Option 2: Include by hand <script src="WickedCool.js"></script> <link rel="stylesheet" href="WickedCool.css" />
  • 182. ADAPTIVE WEB DESIGN WORKSHOP Option 2: Include by hand <script src="WickedCool.js"></script> <link rel="stylesheet" href="WickedCool.css" /> <head> <!-- … --> <link rel="stylesheet" href="WickedCool.css" /> </head> <body> <!-- … --> <script src="WickedCool.js"></script> </body>
  • 183. ADAPTIVE WEB DESIGN WORKSHOP Option 3: Scripted include function FindPath( filename ) { var path = false; var scripts = document.getElementsByTagName( 'script' ); for( var i=0; i<scripts.length; i++ ) { if( scripts[i].getAttribute( 'src' ) && scripts[i].getAttribute( 'src' ) .indexOf( filename ) != -1 ) { path = scripts[i] .getAttribute( 'src' ) .replace( new RegExp( filename ), '' ); break; } } return path; }
  • 184. ADAPTIVE WEB DESIGN WORKSHOP Option 3: Scripted include var WickedCool = { jsFile: 'WickedCool.js', cssFile: 'WickedCool.css', initialize: function(){ // determine the path var path = FindPath( this.jsFile ); // add the CSS file var css = document.createElement( 'link' ); css.setAttribute( 'rel', 'stylesheet' ); css.setAttribute( 'href', path + this.cssFile ); document.getElementsByTagName( 'head' )[0] .appendChild( css ); // do the rest of the wicked cool stuff } };
  • 185. ADAPTIVE WEB DESIGN WORKSHOP Option 4: Scripted embed function addCSS( styles ) { var el = document.createElement( 'style' ); el.setAttribute( 'type', 'text/css' ); if ( el.styleSheet ) { el.styleSheet.cssText = styles; } else { el.appendChild( document.createTextNode( styles ) ); } document.getElementsByTagName( 'head' )[0] .appendChild( el ); }
  • 186. ADAPTIVE WEB DESIGN WORKSHOP Option 4: Scripted embed var WickedCool = { _css: '.wicked { color: red; ' + ' font: bold 4em/2 "Comic Sans"; } ' + '.cool { color: blue; ' + ' font: bold 4em/2' "Comic Sans"; }', initialize: function() { // add the CSS addCSS( this._css ); // do the rest of the wicked cool stuff } }; based on the work of Nicholas Zakas
  • 189. ADAPTIVE WEB DESIGN WORKSHOP How do we do that? .TabInterface-folder { /* ... */ } #TabInterface .tab { /* ... */ } #TabInterface .tab.active { /* ... */ } 172
  • 190. ADAPTIVE WEB DESIGN WORKSHOP How do we do that? Tactic Default Activated add “-on” to the class .tabbed .tabbed-on add an activation class .auto-submit .auto-submit.active change the form of the .replace-me .replaced class
  • 192. ADAPTIVE WEB DESIGN WORKSHOP Adaptive UI
  • 193. ADAPTIVE WEB DESIGN WORKSHOP Swapping content var trigger = 659; // … function toggleDisplay() { var width = $window.width(); if ( showing == 'old' && width <= trigger ) { $old_nav.replaceWith($new_nav); showing = 'new'; } else if ( showing == 'new' && width > trigger ) { $new_nav.replaceWith($old_nav); showing = 'old'; } }
  • 199. ADAPTIVE WEB DESIGN WORKSHOP Semantics <ul> <li> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 200. ADAPTIVE WEB DESIGN WORKSHOP Style? <ul style=”height: 300px;”> <li style=”height: 300px;” > <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li style=”height: 300px;” > <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li style=”height: 300px;” > <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 202. ADAPTIVE WEB DESIGN WORKSHOP Style? <ul class="jcarousel-skin-vr" style=”height: 300px;”> <li style=”height: 300px;”> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li style=”height: 300px;”> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li style=”height: 300px;”> <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 203. ADAPTIVE WEB DESIGN WORKSHOP Script <ul id="vr-carousel"> <li> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach's innovative approach for last mile communities</span> </li> … </ul>
  • 204. ADAPTIVE WEB DESIGN WORKSHOP Script $j('#vr-carousel').jcarousel({ auto: 6, visible: 1, animation: 0, wrap: 'both', scroll: 1, initCallback: vrCarousel_initCallback, itemFirstInCallback: vrCarousel_itemFirstInCallback, itemFirstInCallback: vrCarousel_fadeIn, itemFirstOutCallback: vrCarousel_fadeOut });
  • 205. ADAPTIVE WEB DESIGN WORKSHOP Script function vrCarousel_initCallback( carousel, item, idx, state ) { // Pause autoscrolling if the user moves // with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); $j('.jcarousel-item').css('opacity', 0); };
  • 206. ADAPTIVE WEB DESIGN WORKSHOP Script function vrCarousel_initCallback( carousel, item, idx, state ) { var $i = carousel.list.find(‘img’), h = 0; // get the max h $i.each(function(){ var test = $j(this).height(); if ( test > h ){ h = test; } }); // … carousel.list.height(h); $j('.jcarousel-item').css({ opacity: 0, height: h }); };
  • 208. User Experience Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 209. User Experience Accessibility Interactivity Design Semantics BASIC ADVANCED Browser Capabilities Content
  • 212. “special needs” can be CONTEXTUAL
  • 216. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 217. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 218. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Tweet</button> <a class=”button”>Tweet</a>
  • 219. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Tweet</button> <a class=”button”>Tweet</a>
  • 220. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 221. ADAPTIVE WEB DESIGN WORKSHOP What is it?
  • 222. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Search Mail</button> <div>Search Mail</div>
  • 223. ADAPTIVE WEB DESIGN WORKSHOP What is it? <button>Search Mail</button> <div>Search Mail</div>
  • 224. ADAPTIVE WEB DESIGN WORKSHOP ARIA maps the OS to the web
  • 226. ADAPTIVE WEB DESIGN WORKSHOP All the web’s a play… <section id="main" role="main"> <!-- The primary content for the page would go here --> </section>
  • 232. ADAPTIVE WEB DESIGN WORKSHOP Semantic comparison Ad-hoc ARIA Role HTML5 #header, #top banner header (kind of) #main, #content main none #extra, .sidebar complementary, note aside #footer, #bottom contentinfo footer #nav navigation nav .hentry article article
  • 234. ADAPTIVE WEB DESIGN WORKSHOP These are the droids you seek <span role="button">OK</span> <div role="alert"> <p>Something went wrong.</p> </div> <div role="alertdialog"> <p>Something went wrong.</p> <img src="x.png" alt="dismiss" role="button" /> </div>
  • 235. ADAPTIVE WEB DESIGN WORKSHOP What is it? <a role=”button”>Tweet</a> class=”button”>Tweet</a>
  • 236. ADAPTIVE WEB DESIGN WORKSHOP What is it? <a role=”button”>Tweet</a>
  • 238. ADAPTIVE WEB DESIGN WORKSHOP What’s happening? B B (off) (on) <span> <img src="bold-off.png" alt="bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 239. ADAPTIVE WEB DESIGN WORKSHOP What’s happening? B B (off) (on) <span> <img src="bold-off.png" alt="not bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 240. ADAPTIVE WEB DESIGN WORKSHOP What’s happening? B B (off) (on) <span role="button" aria-pressed="false"> <img src="bold-off.png" alt="not bold" /> </span> <span role="button" aria-pressed="true"> <img src="bold-on.png" alt="bold" /> </span>
  • 241. ADAPTIVE WEB DESIGN WORKSHOP Complex interfaces
  • 242. ADAPTIVE WEB DESIGN WORKSHOP Traditional approach <h1>Pumpkin Pie</h1> <div class="container"> <div class="section"> <h2>Overview</h2> <img src="pie.jpg" alt=""> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> </div> <!-- ... --> <ul class="tabs"> <li><a href="#">Overview</a></li> <li><a href="#">Ingredients</a></li> <li><a href="#">Directions</a></li> <li><a href="#">Nutrition</a></li> </ul> </div>
  • 243. ADAPTIVE WEB DESIGN WORKSHOP Cleaner approach <h1>Pumpkin Pie</h1> <div class="tabbed"> <h2>Overview</h2> <img src="pie.jpg" alt="" /> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> <h2>Ingredients</h2> <ul> <li>1 (9<abbr title="inch">in</abbr>) unbaked deep dish pie crust</li> <li>½ cup white sugar</li> <!-- ... --> </ul> <h2>Directions</h2> <!-- ... --> </div>
  • 244. ADAPTIVE WEB DESIGN WORKSHOP Cleaner approach <h1>Pumpkin Pie</h1> <div class="tabbed"> <h2>Overview</h2> <img src="pie.jpg" alt="" /> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> <h2>Ingredients</h2> <ul> <li>1 (9<abbr title="inch">in</abbr>) unbaked deep dish pie crust</li> <li>½ cup white sugar</li> <!-- ... --> </ul> <h2>Directions</h2> <!-- ... --> </div>
  • 245. ADAPTIVE WEB DESIGN WORKSHOP No JS, basic CSS
  • 246. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Page
  • 247. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Page JS?
  • 248. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Page JS? No
  • 249. ADAPTIVE WEB DESIGN WORKSHOP Widget logic Split Page the content & make some tabs JS? Yes No
  • 250. ADAPTIVE WEB DESIGN WORKSHOP On DOM ready <h1>Pumpkin Pie</h1> <div class="tabbed-on"> <section> <h2>Overview</h2> <img src="pie.jpg" alt=""> <p>Whether you're hosting a festive party or a casual get-together with friends, our Pumpkin Pie will make entertaining easy!</p> <!-- ... --> </section> <!-- ... --> <ul class="tabs"> <li><a href="#">Overview</a></li> <li><a href="#">Ingredients</a></li> <li><a href="#">Directions</a></li> <li><a href="#">Nutrition</a></li> </ul> </div>
  • 251. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tablist" 223
  • 252. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tab" aria-selected="true" aria-controls="folder-1"
  • 253. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tab" aria-selected="false" aria-controls="folder-4"
  • 254. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="tabpanel" aria-hidden="false" aria-labelledby="folder-1-tab"
  • 255. ADAPTIVE WEB DESIGN WORKSHOP Adding ARIA role="application" aria-activedescendant="folder-1"
  • 256. ADAPTIVE WEB DESIGN WORKSHOP Result!
  • 258. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here!
  • 259. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <input class="tweet-counter" value="140" disabled="disabled">
  • 260. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span id="chars_left_notice" class="numeric"> <strong id="status-field-char-counter" class="char-counter">140</strong> </span>
  • 261. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span> .hidden { position: absolute; left: −999em; }
  • 262. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span class="tweet-counter">maximum of 140 characters</span> <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>
  • 263. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here! <span aria-live="polite" aria-atomic="true" class="tweet-counter">140<b class="hidden"> characters remaining</b></span>
  • 264. ADAPTIVE WEB DESIGN WORKSHOP Hey! Over here!
  • 265. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display Effect Effect visibility: hidden; Element is hidden from Content is ignored by screen view, but is not removed readers from the normal flow (i.e. it still takes up the space it normally would) display: none; Element is removed from Content is ignored by screen the normal flow and hidden; readers the space it occupied is collapsed height: 0; Element is collapsed and Content is ignored by screen width: 0; contents are hidden readers overflow: hidden;
  • 266. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display Effect Effect text-indent: -999em; Contents are shifted off- Screen readers have access screen and hidden from to the content, but the view, but links may “focus” content is limited to text and oddly and negative indent inline elements may not prove long enough to fully hide content position: absolute; Content is removed from Screen readers have access left: -999em; the normal flow and shifted to the content off the left-hand edge; the space it occupied is collapsed
  • 267. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display Effect Effect position: absolute; Content is positioned Screen readers have access /* IE6, IE7 */ absolutely (and is removed to the content clip: rect( 1px 1px 1px 1px from the normal flow), but ); remains in place and is /* W3C */ clipped to become invisible clip: rect( 1px, 1px, 1px, 1px ); padding: 0; border: 0; height: 1px; width: 1px; overflow: hidden;
  • 268. ADAPTIVE WEB DESIGN WORKSHOP Typical hiding schemes Accessibility CSS Rules Display Effect Effect visibility: hidden; Element is hidden from Content is ignored by screen view, but is not removed readers from the normal flow (i.e. it still takes up the space it normally would) display: none; Element is removed from Content is ignored by screen the normal flow and hidden; readers the space it occupied is collapsed height: 0; Element is collapsed and Content is ignored by screen width: 0; contents are hidden readers overflow: hidden;
  • 269. ADAPTIVE WEB DESIGN WORKSHOP “Fixing” libraries (function(){ var $button = $('#myButton'), $text = $('#myText'), visible = true; $button.click(function(){ if ( visible ) { $text.slideUp('fast'); } else { $text.slideDown('fast'); } visible = ! visible; }); })();
  • 270. ADAPTIVE WEB DESIGN WORKSHOP “Fixing” libraries (function(){ var $button = $('#myButton'), $text = $('#myText'), visible = true; $button.click(function(){ if ( visible ) { $text.slideUp('fast',function(){ $text.addClass('accessibly-hidden') .slideDown(0); }); } else { $text.slideUp(0,function(){ $text.removeClass('accessibly-hidden') .slideDown('fast'); }); } visible = ! visible; }); })();
  • 271. ADAPTIVE WEB DESIGN WORKSHOP Managing focus <div tabindex="0"> <p>This <code>div</code> can now receive focus using a keyboard’s <kbd>tab</kbd> key. How cool is that?</p> </div> <div tabindex="-1"> <p>This <code>div</code> won’t be focused by a user via the <kbd>tab</kbd> key, but JavaScript can <code>focus()</code> it. Nifty, huh?</p> </div>
  • 274. Header
  • 275. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="header"> <a href="#donate" class="donate-link" title="Click here to view our donation options">Donate</a> <a href="http://villagereach.org/feed/" class="rss-link" title="View our RSS Feed">RSS Feed</a> <div id="site-title"> <a href="http://villagereach.org" title="Village Reach: Home"> <span>Village Reach</span> </a> </div> </div><!-- #header -->
  • 278. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div class="entry-content entry"> <!-- Features --> <div class="boxes three home"> <!-- Programs --> </div> <div id="latestNews"> <!-- Latest News --> </div> </div>
  • 280. Nav
  • 281. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="hybrid-search-3" class="widget search widget-search"> <div class="widget-inside"> <form method="get" class="search-form" id="search-form" action="http://villagereach.org/"> <!--Search Form --> </form><!-- .search-form --> </div> </div> <div id="navigation"> <div id="page-nav" class="page-nav"> <ul class="menu sf-menu"> <!-- Navigation --> </ul> </div> </div><!-- #navigation -->
  • 283. Extra Social Newsletter
  • 284. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="text-8" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Extra --> </div> </div> <div id="text-7" class="widget widget_text widget-widget_text"> <div class="widget-inside"> <!-- Social --> </div> </div> <div id="mc_signup_container"> <!-- Newsletter --> </div>
  • 286. Footer
  • 287. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles <div id="footer-container"> <div id="footer"> <p class="copyright">Copyright &#169; 2011 <a class="site-link" href="http://villagereach.org" title="VillageReach" rel="home"><span>VillageReach</span></a>. - All rights reserved.</p> </div><!-- #footer --> </div><!-- #footer-container -->
  • 291. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles & States <div class="jcarousel-container jcarousel-container-horizontal" style="display: block; "> <ul id="vr-carousel"> <li> <a href="#"><img src="…" alt="" /></a> <span>Your new online source for information on our progress</span> </li> <li> <a href="#"><img src="…" alt="" /></a> <span>VillageReach Announces Mozambique National Expansion</span> </li> … </ul> </div>
  • 292. ADAPTIVE WEB DESIGN WORKSHOP ARIA Roles & States <div id="jcarousel-control"> <div class="jcarousel-prev jcarousel-prev-horizontal" style="display: block; " disabled="false"></div> <span id="jcarousel-control-caption"> VillageReach Announces Mozambique National Expansion </span> <div class="jcarousel-next jcarousel-next-horizontal" style="display: block; " disabled="false"></div> </div>
  • 293. Adaptive Web Design Workshop by Aaron Gustafson More of the same: http://adaptivewebdesign.info http://easy-designs.net http://blog.easy-designs.net http://aaron-gustafson.com Slides available at http://slideshare.net/AaronGustafson © Aaron Gustafson. All Rights Reserved.