UNPKG

820 BHTMLView Raw
1---
2layout: example.html
3title: Accessible Map
4shortdesc: Example of an accessible map.
5docs: >
6 This page's `map` element has its `tabindex` attribute set to `"0"`, that makes it focusable. To focus the map element you can either navigate to it using the "tab" key or use the skip link. When the `map` element is focused the + and - keys can be used to zoom in and out and the arrow keys can be used to pan.
7
8
9 Clicking on the "Zoom in" and "Zoom out" buttons below the map zooms the map in and out. You can navigate to the buttons using the "tab" key, and press the "enter" key to trigger the zooming action.
10
11tags: "accessibility, tabindex"
12---
13<a class="skiplink" href="#map">Go to map</a>
14<div id="map" class="map" tabindex="0"></div>
15<button id="zoom-out">Zoom out</button>
16<button id="zoom-in">Zoom in</button>