Newer
Older
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
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>test slide in "overlay"</title>
<style type="text/css">
#container {
width: 700px;
margin: 0 auto;
border: 1px black solid;
}
.overlay {
display: none;
}
#overlay1-container {
width: 700px;
margin: 0 auto;
border: 1px red solid;
}
#overlay1-content {
width: 400px;
height: 300px;
border: 1px blue solid;
margin: 20px auto;
background: white;
padding: 20px;
/* box-shadow: 2px 2px 2px blue; */
}
#close-overlay1 {
position: relative;
left: 100px;
}
#overlay2 {
width: 200px;
height: 150px;
border: 1px red solid;
position: fixed;
top: 10px;
background: white;
}
</style>
</head>
<body>
<div id="container">
<h3>My Page
<a id="show-overlay1" href="#">overlay1</a>
</h3>
<p>This is the default page content</p>
</div>
<div id="overlay1-container" class="overlay">
<div id="overlay1-content">
<h3>This is overlay title <a id="close-overlay1" href="#">close</a></h3>
<p>This is overlay content</p>
</div>
</div>
<script type="text/javascript" src="vendor/jquery.min.js"></script>
<script type="text/javascript">
$('#show-overlay1').click(function (evt) {
$('#container').hide();
$('#overlay1-container').slideDown();
return false;
});
$('#close-overlay1').click(function (evt) {
$('#overlay1-container').hide();
$('#container').show();
return false;
});
// page init
$('#show-overlay1').click();
</script>
</body>
</html>