-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
252 lines (225 loc) · 5.86 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<html>
<head>
<title>equalheights</title>
<style type="text/css">
body {
width: 800px;
margin: 50px auto;
}
p {margin-bottom: 50px;}
pre {}
#stillToDo {
margin-top: 80px;
}
ul.eqH {
overflow: auto;
padding:0;
margin:0;
margin-bottom: 20px;
display: block;
width: 800px;
clear: both;
margin-top: -25px;
}
ul.eqH li {
width: 180px;
float: left;
margin:0;
list-style: none;
background-color: #E0E1FA;
padding: 10px;
color: #656591;
font-family: Arial, "MS Trebuchet", sans-serif;
font-size: 10px;
}
ul.eqH li:nth-child(2n) {
background-color: #C0C1E8;
}
/*unique diffs for testing*/
#row1 li:last-child {
padding-top: 30px;
}
#row2 li {
padding-top: 30px;
padding-bottom: 30px;
}
#row3 li:nth-child(2n) {
padding-bottom: 30px;
}
.download {float: right;}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="jquery.equalHeights-0.0.2.js"></script>
<!-- highlight.js stuff -->
<script type="text/javascript" src="http://yandex.st/highlightjs/6.1/highlight.min.js"></script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/github.min.css" type="text/css">
<script type="text/javascript">
// highlight code
hljs.tabReplace = ' ';
hljs.initHighlightingOnLoad();
</script>
</head>
<body>
<a href="http://github.com/christopherdebeer/jquery.equalHeights.js"><img alt="Fork me on GitHub" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" style="position: absolute; top: 0; right: 0; border: 0;"></a>
<div class="download">
<a href="http://github.com/christopherdebeer/jquery.equalHeights.js/zipball/master">
<img width="90" border="0" src="http://github.com/images/modules/download/zip.png"></a>
<a href="http://github.com/christopherdebeer/jquery.equalHeights.js/tarball/master">
<img width="90" border="0" src="http://github.com/images/modules/download/tar.png"></a>
</div>
<h1>jQuery.equalHeights-0.0.2.js</h1>
<p>
The equal heights script to end all equal heights scripts. The plan is, once this one is done, I will never need to write another, as all the use cases should already be accounted for.
</p>
<h3>Usage</h3>
<pre>
<code class="javascript">
$(".equalHeights").equalHeights(options);
</code>
</pre>
<h3>Defaults & Options</h3>
<pre><code class="javascript">
$("ul li").equalHeights({
cols: 2, // any integer > 0
accountForPadding: true, // true , false
padding: false, // true / "both", "bottom", "top", false
margin: false, // true / "both", "bottom", "top", false
animation: false, // true / "slow", "normal", "fast", false
animationCallback: undefined // callback on completion of animation
});
</code></pre>
<h3>Reset / Undo</h3>
<pre>
<code class="javascript">
// to undo equalHeights,
// and set the elements to their original state
// do the following
$(".eqH").equalHeights.reset();
</code>
</pre>
<a href="javascript:$('.eqH').equalHeights.reset();">Click here to Reset examples</a> || <a href="javascript:window.eqHexamples(jQuery);">Click here to redo all examples</a>
<h2>Examples</h2>
<pre>
<code class="javascript">
$("#row0 li").equalHeights({
cols: 4,
});
</code>
</pre>
<ul class="eqH" id="row0">
<li>One liner</li>
<li>This is on<br/>two lines</li>
<li>Another one liner</li>
<li>Whoa<br/>three whole<br/>lines</li>
</ul>
<pre>
<code class="javascript">
$("#row1 li").equalHeights({
cols: 4,
padding: "bottom",
animation: "slow",
accountForPadding: false
});
</code>
</pre>
<ul class="eqH" id="row1">
<li>One liner</li>
<li>This is on<br/>two lines</li>
<li>Another one liner</li>
<li>Whoa<br/>three whole<br/>lines</li>
</ul>
<pre>
<code class="javascript">
$("#row2 li").equalHeights({
// cols will default to 2
padding: "top",
animation: "slow",
animationCallback: function (x) {
console.log("animation callback called.", x);
}
});
</code>
</pre>
<ul class="eqH" id="row2">
<li>One liner</li>
<li>This is on<br/>two lines</li>
<li>Another one liner</li>
<li>Whoa<br/>three whole<br/>lines</li>
</ul>
<pre>
<code class="javascript">
$("#row3 li").equalHeights({
cols: 4,
padding: "bottom"
});
</code>
</pre>
<ul class="eqH" id="row3">
<li>One liner</li>
<li>This is on<br/>two lines</li>
<li>Another one liner</li>
<li>Whoa<br/>three whole<br/>lines</li>
</ul>
<pre>
<code class="javascript">
$("#row4 li").equalHeights({
cols: 4,
margin: "top",
animation: "slow"
});
</code>
</pre>
<ul class="eqH" id="row4">
<li>One liner</li>
<li>This is on<br/>two lines</li>
<li>Another one liner</li>
<li>Whoa<br/>three whole<br/>lines</li>
</ul>
<h2 id="stillToDo">Still to do</h2>
<ol>
<li>padding: "both"</li>
<li>margin: "both"</li>
<li>accountForPadding: true</li>
<li>combinations of paddings and margins</li>
<li>live mode to continually update heights on change</li>
</ol>
<script type="text/javascript">
window.eqHexamples = function($){
$("#row0 li").equalHeights({
cols: 4,
});
$("#row1 li").equalHeights({
cols: 4,
padding: "bottom",
animation: "slow",
animationCallback: function (x) {
console.log("animation callback called.", x);
},
accountForPadding: false
});
$("#row2 li").equalHeights({
// cols will default to 2
padding: "top",
animation: "slow",
animationCallback: function (x) {
console.log("animation callback called.", x);
}
});
$("#row3 li").equalHeights({
cols: 4,
padding: "bottom"
});
$("#row4 li").equalHeights({
cols: 4,
margin: "top",
animation: "slow"
});
};
(function($) {
$(document).ready(function(){
window.eqHexamples($)
});
})(jQuery);
</script>
</body>
</html>