forked from nathanyarnold/rHeight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
152 lines (132 loc) · 5.67 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta id="metaViewport" content="width=device-width, initial-scale=1" name="viewport">
<title>Full Height Modules</title>
<style>
/* PAGE STYLES, FOR THIS DEMO ONLY */
* {-webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; }
body {margin:0; padding:0; text-align:left; font-family:arial;}
#hd {height:60px; border-bottom:1px solid black; padding:10px; background:#000;
position:fixed; top:0; left:0; width:100%; z-index:10}
#hd h1 {font-size:140%; margin:6px 10px 0; padding:0; color:#fff}
#bd {position:relative; z-index:1; margin-top:60px; margin-bottom:24px;}
#ft {height:24px; border-top:1px solid black; padding:0 10px; background:#000;
position:fixed; bottom:0; left:0; width:100%; z-index:10}
#ft p {margin:2px 10px 0; padding:0; font-size:92%; color:#fff; background:#000}
@media (min-width:640px) {
#hd {height:100px}
#hd h1 {margin-top:20px}
#bd {margin-top:100px; margin-bottom:40px}
#ft {height:40px;}
#ft p {font-weight:bold; margin-top:10px}
}
/* APP STYLES */
div.wrapper {background:red; width:100%; padding:20px; position:relative;}
div#two {background:blue}
div#three {background:green}
div#four {background:orange; padding-right:70px;}
div#five {background:blue}
h2,p {background:#fff; display:block; padding:4px 10px; margin:20px 0 10px}
span {position:absolute; top:0; right:0; padding:20px; width:100px; height:100px; background:#aaa; z-index:1000;}
div#one span,
div#four span {height:auto}
div#six span {background:yellow}
div.cnt {position:relative; z-index:100; }
div.bg {background-position:50% 50%; background-size:cover;
bottom:0; left:0; right:0; top:0; position:absolute; opacity:1; z-index:10;
background-image: url('_img/square_600.png');
}
/* 601px - 1200px */
@media (min-width:601px) {
div.bg {background-image: url('_img/square_1200.png')}
}
@media (min-height:601px) {
div.bg {background-image: url('_img/square_1200.png')}
}
/* 1201px - 1920px */
@media (min-width:1201px) {
div.bg {background-image: url('_img/square_1920.png')}
}
@media (min-height:1201px) {
div.bg {background-image: url('_img/square_1920.png')}
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="rHeight.js"></script>
</head>
<body>
<div id="hd">
<h1>Fixed-height modules</h1>
</div><!-- #hd -->
<div id="bd">
<div class="wrapper" id="one"
data-rheight="true"
data-rheight-offset="#hd, #ft">
<div class="cnt">
<h2>Title, block #1</h2>
<p>Paragraph text, block #1. No min-width threshold. No min-width requirement. No min-height requirement. Allow dynamic offset of header/footer height.</p>
</div>
<div class="bg"></div>
<span class="childNode" data-rheight-child="true" data-rheight-child-attr="margin-top" data-rheight-child-offset="90%">This is a child node, set 10% down the module.</span>
</div><!-- .wrapper#one -->
<div class="wrapper" id="two"
data-rheight="true"
data-rheight-attr="min-height"
data-rheight-threshold-width="500">
<div class="cnt">
<h2>Title, block #2</h2>
<p>Paragraph text, block #2. Min-width threshold of 500px. NO offset of header/footer height.</p>
</div>
<div class="bg"></div>
</div><!-- .wrapper#two -->
<div class="wrapper" id="three"
data-rheight="true"
data-rheight-attr="min-height"
data-rheight-minheight="1:1"
data-rheight-offset="#hd, #ft">
<div class="cnt">
<h2>Title, block #3</h2>
<p>Paragraph text, block #3. No min-width threshold. Min-height of 1:1 ratio. Dynamic offset of header/footer height.</p>
</div>
<div class="bg"></div>
</div><!-- .wrapper#three -->
<div class="wrapper" id="four"
data-rheight="true"
data-rheight-attr="min-height"
data-rheight-maxheight="1:1"
data-rheight-offset="#hd, #ft">
<div class="cnt">
<h2>Title, block #4</h2>
<p>Paragraph text, block #4. No min-width threshold. Max-height of 1:1. Dynamic offset of header/footer height. With child-node.</p>
</div>
<div class="bg"></div>
<span class="childNode" data-rheight-child="true" data-rheight-child-attr="center">This is a child node, vertically centred.</span>
</div><!-- .wrapper#four -->
<div class="wrapper" id="five"
data-rheight="true"
data-rheight-threshold-height="500">
<div class="cnt">
<h2>Title, block #5</h2>
<p>Paragraph text, block #5. Min-height threshold of 500px. NO offset of header/footer height.</p>
</div>
<div class="bg"></div>
<span class="childNode" data-rheight-child="true" data-rheight-child-attr="height">This is a child node.</span>
</div><!-- .wrapper#five -->
<div class="wrapper" id="six"
data-rheight="true"
data-rheight-threshold-height="500">
<div class="cnt">
<h2>Title, block #6</h2>
<p>Paragraph text, block #5. Min-height threshold of 500px. NO offset of header/footer height.</p>
</div>
<div class="bg"></div>
<span class="childNode" data-rheight-child="true" data-rheight-child-attr="height" data-rHeight-child-offset="100">This is a child node, with 100px offset.</span>
</div><!-- .wrapper#six -->
</div><!-- #bd -->
<div id="ft">
<p>Footer goes here<p>
</div><!-- #ft -->
</body>
</html>