forked from brunosimon/burno.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
breakpoints.html
86 lines (76 loc) · 2.36 KB
/
breakpoints.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Burno.js - Demo - Breakpoints</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link rel="stylesheet" href="../src/css/style.css">
</head>
<body>
<div class="element breakpoints"></div>
<!-- B.js -->
<script src="../../builds/burno-0.2.js"></script>
<script>
var breakpoints = new B.Tools.Breakpoints( {
breakpoints :
[
{
name : 'large',
width :
{
value : 960,
extreme : 'min',
included : false
}
},
{
name : 'medium',
width :
{
value : 960,
extreme : 'max',
included : true
}
},
{
name : 'small',
width :
{
value : 500,
extreme : 'max',
included : true
},
height :
{
value : 500,
extreme : 'max',
included : true
}
}
]
} );
breakpoints.on( 'update', function( breakpoints )
{
var text = [];
text.push( '<strong>' );
text.push( 'breakpoints' );
text.push( '</strong>' );
text.push( '<table>' );
for( var name in breakpoints )
{
text.push( '<tr>' );
text.push( '<td class="label">' );
text.push( 'name' );
text.push( '</td>' );
text.push( '<td class="value">' );
text.push( name );
text.push( '</td>' );
text.push( '</tr>' );
}
text.push( '</table>' );
// Add to DOM
document.querySelector( '.element.breakpoints' ).innerHTML = text.join( '' );
} );
</script>
</body>
</html>