show & tell - a more accessible accordion

14
A more accessible ACC ORD ION

Upload: dandineenuob

Post on 15-Apr-2017

133 views

Category:

Design


0 download

TRANSCRIPT

Page 1: Show & tell - A more accessible accordion

A more accessible

ACC ORD I O N

Page 2: Show & tell - A more accessible accordion

The anatomy of an accordion

Header

Content panel

Closed Open

Page 3: Show & tell - A more accessible accordion

Two different UI patterns

Accordion Collapsible section (Show/hide)

Page 4: Show & tell - A more accessible accordion

Why use an accordion or show/hide?

Large amounts of content - Shortens the page initially

Content ‘options’ - Pay by debit card, credit card or cash

Comparisons between content - Burgers or pizzas

Comparisons don’t work unless content sections are adjacent

‘On load’ content may not be relevant to the user

Reliant on Javascript for the functionality

Page 5: Show & tell - A more accessible accordion

What do we currently have?

Bespoke accordion scripts

4Bespoke hide/show

script

1&

* that I have found so far

Page 6: Show & tell - A more accessible accordion

What do we want?

accessible, flexible, robust script

to rule them all

1

Page 7: Show & tell - A more accessible accordion

What’s wrong with the current scripts?

The Foundation 5 accordion script is very basic

Duplicate functionality but in different ways

Lag behind the current accessibility standards

Page 8: Show & tell - A more accessible accordion

Viewing accordions with assistive technology

How do screen-readers like JAWS deal with accordion content?

If we haven’t considered accessibility then either…

The user gets *EVERYTHING* The user gets *NOTHING*

Page 9: Show & tell - A more accessible accordion

Why change the scripts?

We have a commitment to support *all* our users

This means working to meet WCAG2 standards (Web Content Accessibility Guidelines)

Page 10: Show & tell - A more accessible accordion

How to (start) fixing things

Judicious application of WAI-ARIA roles & attributes Web Accessibility Initiative - Accessible Rich Applications Suite

WAI-ARIA, the Accessible Rich Internet Applications Suite, defines a way to make Web content and Web applications more accessible to people with disabilities. It especially helps with dynamic content and advanced user interface controls developed with Ajax, HTML, JavaScript, and related technologies.

http://www.w3.org/WAI/intro/aria

Page 11: Show & tell - A more accessible accordion

How to (start) fixing things

HTML

<div id="showhide" role="tablist">

<h1 id="showhide-header-0" role="tab" tabindex=“-1">Header One</h1>

<div aria-labelledby=“showhide-header-0">This is content…</div>

<h1 id="showhide-header-1" role="tab" tabindex="-1">Header Two</h1>

<div aria-labelledby="showhide-header-1">This is content…</div>

<h1 id="showhide-header-2" role="tab" tabindex="-1">Header Three</h1>

<div aria-labelledby="showhide-header-2">This is content…</div>

<h1 id="showhide-header-3" role="tab" tabindex="-1">Header Four</h1>

<div aria-labelledby="showhide-header-3">This is content…</div>

</div>

Page 12: Show & tell - A more accessible accordion

To be applied to the active/selected header element

aria-controls="header-id"

aria-selected="true"

To be applied to all unselected header elements

aria-selected="false"

Javascript

How to (start) fixing things

Page 13: Show & tell - A more accessible accordion

Beyond the script

Visual affordance Animation Consistent patterns

Well documented

Easy to implement

Macro/shortcode

[+] [-]

Page 14: Show & tell - A more accessible accordion

Fin