-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
153 lines (125 loc) · 3.43 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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<!-- META -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- tell mobile browsers to scale -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>colRespond Test Page</title>
<!-- Media queries setting coloums to body:after content -->
<style type="text/css">
/*
You should remove the element containing coloum data
body:after { display: none; }
*/
@media screen and (min-width: 15em) {
body:after { content: "4"; }
}
@media screen and (min-width: 30.0625em) {
body:after { content: "6"; }
}
@media screen and (min-width: 37.5em) {
body:after { content: "8"; }
}
@media screen and (min-width: 57em) {
body:after { content: "12"; }
}
@media screen and (min-width: 75em) {
body:after { content: "16"; }
}
</style>
</head>
<body>
<p id="output"></p>
<!-- Javascript -->
<script>
// make console.log safe to use
window.console||(console={log:function(){}});
</script>
<script src="js/jColumnRespond.js"></script>
<script>
// call colRespond and add breakpoints
var colRes = colRespond([
{
label: 'handheld',
coloums: 4
},{
label: 'small-tablet',
coloums: 6
},{
label: 'large-tablet',
coloums: 8
},{
label: 'laptop',
coloums: 12
},{
label: 'desktop',
coloums: 16
}
]);
// usage
var outputStr = document.getElementById('output');
colRes.addFunc({
breakpoint: ['laptop','tablet'],
enter: function() {
console.log('>>> run this for the LAPTOP/TABLET breakpoint <<<');
},
exit: function() {
console.log('<<< destroy this when exiting the LAPTOP/TABLET breakpoint >>>');
}
});
colRes.addFunc({
breakpoint: 'desktop',
enter: function() {
console.log('>>> run this for the DESKTOP breakpoint <<<');
outputStr.innerHTML = 'current breakpoint: desktop';
},
exit: function() {
console.log('<<< destroy this when exiting the DESKTOP breakpoint >>>');
}
});
colRes.addFunc({
breakpoint: 'laptop',
enter: function() {
outputStr.innerHTML = 'current breakpoint: laptop';
}
});
colRes.addFunc({
breakpoint: 'large-tablet',
enter: function() {
outputStr.innerHTML = 'current breakpoint: large-tablet';
}
});
colRes.addFunc({
breakpoint: 'small-tablet',
enter: function() {
outputStr.innerHTML = 'current breakpoint: small-tablet';
}
});
colRes.addFunc({
breakpoint: 'handheld',
enter: function() {
console.log('>>> run this for the HANDHELD breakpoint <<<');
outputStr.innerHTML = 'current breakpoint: handheld';
},
exit: function() {
console.log('<<< destroy this when exiting the HANDHELD breakpoint >>>');
}
});
colRes.addFunc({
breakpoint: '*',
enter: function() {
console.log('>>> run this when entering EVERY breakpoint <<<');
},
exit: function() {
console.log('<<< run this when exiting EVERY breakpoint >>>');
}
});
</script>
</body>
</html>