-
Notifications
You must be signed in to change notification settings - Fork 0
/
tooltips.html
22 lines (22 loc) · 2.24 KB
/
tooltips.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html lang="en">
<head>
<title>Accessible Tooltip Examples</title>
<link rel="stylesheet" type="text/css" href="/stylesheets/tooltips_stylesheet.css">
<script src="/javascripts/tooltips_javascript.js"></script>
</head>
<body>
<h1>Accessible Tooltip Examples</h1>
<p>This page includes different tooltip examples. A tooltip is typically used to display more information about content on a screen and is generally displayed when placing the mouse cursor over an element such as an icon or a link.</p>
<p>Concepts included in this example include:</p>
<ul>
<li>The ARIA <a href="https://www.w3.org/TR/wai-aria-1.1/#tooltip">tooltip</a> role has been used for the elements containing tooltip information.</li>
<li>The ARIA <a href="https://www.w3.org/TR/wai-aria-1.1/#aria-describedby">aria-describedby</a> property is applied to the control spawning the tooltip and references the contents of the tooltip. This ensures that the tooltip is announced upon receiving focus.</li>
</ul>
<hr>
<p>This sentence uses a <a href="#" aria-describedby="link_tooltip" onfocus="document.getElementById('link_tooltip').style.display='block';" onmouseover="document.getElementById('link_tooltip').style.display='block';" onblur="document.getElementById('link_tooltip').style.display='none';" onmouseout="document.getElementById('link_tooltip').style.display='none';">link</a> to display more information.</p>
<div role="tooltip" class="tooltip" id="link_tooltip">This is a sample link tooltip with more information about the link.</div>
<p>This example uses an icon image link after the sentence to toggle the tooltip information.<a href="#" aria-describedby="icon_cooltip" onfocus="document.getElementById('icon_tooltip').style.display='block';" onmouseover="document.getElementById('icon_tooltip').style.display='block';" onblur="document.getElementById('icon_tooltip').style.display='none';" onmouseout="document.getElementById('icon_tooltip').style.display='none';"><img src="/images/tooltip_icon.png" style="width: 15px; height: 15px;" alt="Information Tooltip"></a></p>
<div role="tooltip" class="tooltip" id="icon_tooltip">This is a sample tooltip triggered by an icon with more information about the link.</div>
</body>
</html>