forked from nico3333fr/jquery-accessible-modal-window-aria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
64 lines (53 loc) · 1.66 KB
/
sample.html
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example modal</title>
<meta charset="utf-8" />
<meta name="author" content="Nicolas Hoffmann" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="https://rocssti.net/downloads/rocssti-fr.css" />
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://a11y.nicolas-hoffmann.net/modal/js/jquery-accessible-modal-window-aria.js"></script>
<style>
#page {
width: 960px;
}
dialog {
display: block;
}
.modal {
position: fixed;
left: 25%;
right: auto;
top: 25%;
width: 50%;
margin: 0 auto;
border: 1px solid red;
background: #fff;
z-index: 667;
padding: 2em;
}
.modal-overlay {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: #000;
opacity: .6;
z-index: 666;
}
</style>
</head>
<body role="document">
<div id="page">
<h1>Modal on a link/button</h1>
<p>blablablala <a href="#" class="js-modal" data-modal-text="hello world !" data-modal-title="Here a title" data-modal-close-text="Close" data-modal-close-title="Close this window">1st modal</a></p>
<p>blablablala <button class="js-modal" data-modal-content-id="modal_id" data-modal-title="Here another title" data-modal-close-text="Close it" data-modal-close-title="Close this window, really">another modal</button></p>
<p>here another content.</p>
<p>here another content with <a href="#">a link without modal</a>.</p>
<div id="modal_id" class="hidden">coucou tu veux <a href="#">voir</a> ?</div>
</div>
</body>
</html>