forked from fearphage/jquery-fullscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
32 lines (30 loc) · 1.92 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>fullscreen event handler example</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.fullscreen.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var textToggle = function(text) { $("#toggle").text("currently at " + text); };
var textState = function(text) { $("#state").text(text); };
var textKeyb = function(k, a) { $("#key").append(k + " (" + a + ") shortcut key pressed<br>"); };
$(window).bind('fullscreen-toggle', function(e, state) { textToggle(state); })
.bind('fullscreen-on', function(e) { textState("toggle on"); })
.bind('fullscreen-off', function(e) { textState("toggle off"); })
.bind('fullscreen-key', function(e, k, a) { textKeyb(k, a); });
$(function() {
textToggle($(window).data('fullscreen-state'));
});
</script>
</head>
<body>
<h1>fullscreen event handler example</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p id="toggle"></p>
<p id="state"></p>
<p id="key"></p>
</body>
</html>