Skip to content

Commit 6a9749d

Browse files
committed
simple go to fullscreen on the single element - though CSS is not working yet
1 parent 9a58344 commit 6a9749d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

demos.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"url": "fullscreen",
55
"tags": "fullscreen",
66
"support": {
7-
"live": "opera",
8-
"nightly": "chrome firefox safari"
7+
"live": "opera chrome firefox safari",
8+
"nightly": ""
99
},
10-
"test": ""
10+
"test": "document.body.requestFullscreen !== undefined"
1111
},
1212
{
1313
"desc": "Stream video and filter with canvas",

demos/fullscreen.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<p>This example shows how an element can request fullscreen support from the browser.</p>
1313
<p id="unavailable">Not supported :(</p>
1414
<div id="game">
15-
15+
<button id="gofull">Go fullscreen</button>
16+
<button id="goback">Go back to non-fullscreen</button>
1617
</div>
1718
</article>
1819
<script>
@@ -39,12 +40,18 @@
3940
return !!shim(document.body)
4041
}
4142

42-
var no = $('#unavailable');
43+
var no = $('unavailable'),
44+
go = $('gofull'),
45+
back = $('goback');
4346

4447
if (available()) {
4548
no.parentNode.removeChild(no);
4649
}
4750

51+
go.onclick = function () {
52+
shim(this.parentNode).call(this.parentNode);
53+
}
54+
4855

4956

5057

0 commit comments

Comments
 (0)