-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
103 lines (86 loc) · 3.43 KB
/
demo.html
File metadata and controls
103 lines (86 loc) · 3.43 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
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
<!--
This demo is strictly to demonstrate the features and usage of
responder and does not necessarily represent best practices.
-->
<!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 charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style>
body { font-family: sans-serif; }
body.mobile-portrait { color: #00c; }
body.mobile-landscape { color: #009; }
body.tablet-portrait { color: #006; }
body.tablet-landscape { color: #003; }
body.desktop { color: #000; }
header h1 { color: #fff; padding: 20px; font-weight: normal;}
p { padding: 0px 20px; }
h2 { padding: 0px 20px; }
.desktop header { background: #000; }
.tablet-landscape header { background: #003; }
.tablet-portrait header { background: #006; }
.mobile-landscape header { background: #009; }
.mobile-portrait header { background: #00c; }
</style>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header>
<h1>Responder Demo</h1>
</header>
<p>Resize the browser window to trigger different break points.</p>
<h2></h2>
<p class="breakpoint-info"></p>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<script src="responder.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
// Apply the responder to the 'body' element with the default break points
$('body').responder();
// Bind to the mobile portrait break point
$('body').bind('breakpoint320', function(event, breakpoint) {
$('header h1').text("Mobile Portrait");
});
// Bind to the mobile landscape break point
$('body').bind('breakpoint480', function() {
$('header h1').text("Mobile Landscape");
});
// Bind to the tablet portrait break point
$('body').bind('breakpoint768', function() {
$('header h1').text("Tablet Portrait");
});
// Bind to the tablet landscape break point
$('body').bind('breakpoint1024', function() {
$('header h1').text("Tablet Landscape");
});
// Bind to the desktop break point
$('body').bind('breakpoint1280', function() {
$('header h1').text("Desktop");
});
// Bind to all of the break points
$('body').bind(
'breakpoint320 breakpoint480 breakpoint768 breakpoint1024 breakpoint1280',
function(event, breakpoint) {
displayBreakpoint(breakpoint);
}
);
function displayBreakpoint(bp) {
$('h2').text('Current Break Point:');
$('.breakpoint-info').html(
'Width: ' + bp.width + '<br />' +
'Class Name: ' + bp.className
);
};
});
</script>
</body>
</html>