-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
71 lines (70 loc) · 3.6 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<title>pointbreak.js</title>
<script type="text/javascript" src="pointbreak.js"></script>
</head>
<body>
<script type="text/javascript">
// Set up site break points
PointBreak.set("xsmall" , "(max-width: 319px)");
PointBreak.set("small" , "(min-width: 320px) and (max-width: 479px)");
PointBreak.set("medium" , "(min-width: 480px) and (max-width: 767px)");
PointBreak.set("large" , "(min-width: 768px) and (max-width: 1023px)");
PointBreak.set("xlarge" , "(min-width: 1024px)");
// Get a previously specified media query and add listeners
PointBreak
.get("small")
.now('match', function(point, data) {
// Called immediately if match is true
console.log('now match', point, data);
}, { testdata: 'now match' })
.now('unmatch', function(point, data) {
// Called immediately if match is false
console.log('now unmatch', point, data);
}, { testdata: 'now unmatch' })
.once('match', function(point, data) {
// Called once if match is true
console.log('once match', point, data);
}, { testdata: 'once match' })
.once('unmatch', function(point, data) {
// Called once if match is false
console.log('once unmatch', point, data);
}, { testdata: 'once umatch' })
.on('match', function(point, data) {
// Called each time match is true
console.log('match', point, data);
}, { testdata: 'match' })
.on('unmatch', function(point, data) {
// Called each time match is false
console.log('unmatch', point, data);
}, { testdata: 'unmatch' });
PointBreak
.get("xsmall")
.now('match', function(point, data) {
// Called immediately if match is true
console.log('now match', point, data);
}, { testdata: 'now match' })
.now('unmatch', function(point, data) {
// Called immediately if match is false
console.log('now unmatch', point, data);
}, { testdata: 'now unmatch' })
.once('match', function(point, data) {
// Called once if match is true
console.log('once match', point, data);
}, { testdata: 'once match' })
.once('unmatch', function(point, data) {
// Called once if match is false
console.log('once unmatch', point, data);
}, { testdata: 'once unmatch' })
.on('match', function(point, data) {
// Called each time match is true
console.log('match', point, data);
}, { testdata: 'match' })
.on('unmatch', function(point, data) {
// Called each time match is false
console.log('unmatch', point, data);
}, { testdata: 'unmatch' });
</script>
</body>
</html>