Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (65 loc) · 2.45 KB
/
Copy pathindex.html
File metadata and controls
72 lines (65 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>basic-current-anchor</title>
<!-- TODO: Use npm distribution of v1 polyfills when available. -->
<script src="../demos/bower_components/shadydom/shadydom.min.js"></script>
<script src="../demos/bower_components/custom-elements/custom-elements.min.js"></script>
<script src="../demos/bower_components/custom-elements/src/native-shim.js"></script>
<script src="../demos/bower_components/custom-elements/src/htmlelement-instanceof.js"></script>
<script src="./dist/basic-current-anchor.js"></script>
<link rel="stylesheet" href="../demos/demos.css">
<style>
basic-current-anchor {
color: black;
text-decoration: underline;
}
basic-current-anchor.current {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<p>
The links on this page highlight themselves as appropriate. They will appear
current (bold) when the current page address matches their link destination.
As an example, the links below navigate to anchors within the page. As you
navigate (by clicking, editing the address bar, going back/forward), the
links will update their own current state.
</p>
<ul>
<li>
<basic-current-anchor href="#one">One</basic-current-anchor>
</li>
<li>
<basic-current-anchor href="#two">Two</basic-current-anchor>
</li>
<li>
<basic-current-anchor href="#three">Three</basic-current-anchor>
</li>
</ul>
<p>
A link of this type can also represent an area within a site, not just a
single page. Such a link will be marked as current whenever the user is at a
destination at or below the point in the navigational hierarchy indicated
by the link's destination.
</p>
<ul>
<li>
<basic-current-anchor href="./">Page link</basic-current-anchor>.
The link only appears current when the current page address matches the
link destination. In this demo, it will only appear current if there is
no "#" hash anchor in the address bar.
</li>
<li>
<basic-current-anchor href="./" area-link='true'>Area link</basic-current-anchor>.
The link goes to the same destination as the page link above, but appears
current whenever the current page address matches the prefix indicated by
the link destination. In this demo, it will always show as current.
</li>
</ul>
</body>
</html>