-
Notifications
You must be signed in to change notification settings - Fork 12
/
advanced.html
79 lines (56 loc) · 2.12 KB
/
advanced.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>EqualHeight.js | Advanced</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Advanced</h1>
<p>In this example, the plugin only works when the window has a minimum width of 500 pixels.</p>
<div class="Grid Grid--demo">
<div class="Grid-col">
<p>Quod, corporis, doloribus, debitis recusandae illum sed assumenda rem sapiente cum soluta architecto cumque repellat quisquam eius ipsa ab dolores libero a!</p>
</div>
<div class="Grid-col">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, quam eos vitae atque libero doloribus sunt nobis maiores aspernatur ducimus dolor error necessitatibus recusandae. Neque a ea rerum accusantium est. Lorem</p>
</div>
<div class="Grid-col">
<p>Facilis, optio.</p>
</div>
<div class="Grid-col">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quidem, quam eos vitae atque libero doloribus sunt nobis maiores aspernatur ducimus dolor error necessitatibus recusandae.</p>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="../dist/jquery.equalheight.min.js"></script>
<script>
$(document).ready(function () {
var equalHeight = $('.Grid--demo p').equalHeight({wait: true});
// Browser supports matchMedia
if (window.matchMedia) {
// MediaQueryList
var mql = window.matchMedia("(min-width: 500px)");
// MediaQueryListListener
var equalHeightCheck = function (mql) {
if (mql.matches) {
equalHeight.start();
} else {
equalHeight.stop();
}
};
// Add listener
mql.addListener(equalHeightCheck);
// Manually call listener
equalHeightCheck(mql);
}
// Browser doesn't support matchMedia
else {
equalHeight.start();
}
});
</script>
</body>
</html>