-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.html
More file actions
41 lines (40 loc) · 1.78 KB
/
test.html
File metadata and controls
41 lines (40 loc) · 1.78 KB
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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>jQuery Bootstrap 3 Breakpoint Check</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="page-header">
<h1>jQuery bootstrap 3 breakpoint check</h1>
<p class="lead">Simple demo which illustrates which breakpoint is currently active.</p>
</div>
<div class="row example">
<div class="col-xs-3 example-xs"><div class="well">Current bootstrap breakpoint: "xs"</div></div>
<div class="col-xs-3 example-sm"><div class="well">Current bootstrap breakpoint: "sm"</div></div>
<div class="col-xs-3 example-md"><div class="well">Current bootstrap breakpoint: "md"</div></div>
<div class="col-xs-3 example-lg"><div class="well">Current bootstrap breakpoint: "lg"</div></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/jquery-breakpoint-check.min.js"></script>
<script>
$(window).resize(function () {
var successClass = "text-success text-uppercase";
$(".example .well").removeClass(successClass).removeAttr('style');
if ($.isXs()) {
$(".example-xs .well").addClass(successClass).css('border-color', 'green');
} else if ($.isSm()) {
$(".example-sm .well").addClass(successClass).css('border-color', 'green');
} else if ($.isMd()) {
$(".example-md .well").addClass(successClass).css('border-color', 'green');
} else if ($.isLg()) {
$(".example-lg .well").addClass(successClass).css('border-color', 'green');
}
}).resize();
</script>
</body>
</html>