-
Notifications
You must be signed in to change notification settings - Fork 0
/
tester.html
63 lines (54 loc) · 1.53 KB
/
tester.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
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Test</title>
<script src="../bin/responsive_handler.js" type="text/javascript" charset="utf-8"></script>
<script src="../bower_components/jquery/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var responsive = new ResponsiveHandler({
mobile: "0px-400px",
tablet: "400px-600px",
retina: "600px-1200px",
desktop: "1200px-max"
});
responsive.retina(function() {
$("#colorbox").css("background", "purple")
.html("Retina!");
});
responsive.mobile(function() {
$("#colorbox").css("background", "red")
.html("Mobile!");
});
responsive.tablet(function() {
$("#colorbox").css("background", "blue").html("Tablet!");
});
responsive.desktop(function() {
$("#colorbox").css("background", "green").html("Desktop!");
});
responsive.retina().mobile(function() {
$("#colorbox").append("<br><h3>Retina & Mobile</h3>");
});
$(document).ready(function() {
responsive.invokeActionsForScreenSize(document.documentElement.clientWidth);
});
$(window).resize(function() {
responsive.invokeActionsForScreenSize(document.documentElement.clientWidth);
});
</script>
<style type="text/css" media="all">
#colorbox {
width: 200px;
height: 200px;
}
#colorbox {
text-align: center;
color: #fff;
font: 30px Helvetica;
padding-top: 85px;
}
</style>
</head>
<body>
<div id="colorbox"></div>
</body>
</html>