Skip to content
Browse files

simple go to fullscreen on the single element - though CSS is not wor…

…king yet
  • Loading branch information...
1 parent 9a58344 commit 6a9749da6c57777245f65f6ac2f50ed83c30aac8 @remy committed Jan 13, 2013
Showing with 12 additions and 5 deletions.
  1. +3 −3 demos.json
  2. +9 −2 demos/fullscreen.html
View
6 demos.json
@@ -4,10 +4,10 @@
"url": "fullscreen",
"tags": "fullscreen",
"support": {
- "live": "opera",
- "nightly": "chrome firefox safari"
+ "live": "opera chrome firefox safari",
+ "nightly": ""
},
- "test": ""
+ "test": "document.body.requestFullscreen !== undefined"
},
{
"desc": "Stream video and filter with canvas",
View
11 demos/fullscreen.html
@@ -12,7 +12,8 @@
<p>This example shows how an element can request fullscreen support from the browser.</p>
<p id="unavailable">Not supported :(</p>
<div id="game">
-
+ <button id="gofull">Go fullscreen</button>
+ <button id="goback">Go back to non-fullscreen</button>
</div>
</article>
<script>
@@ -39,12 +40,18 @@
return !!shim(document.body)
}
-var no = $('#unavailable');
+var no = $('unavailable'),
+ go = $('gofull'),
+ back = $('goback');
if (available()) {
no.parentNode.removeChild(no);
}
+go.onclick = function () {
+ shim(this.parentNode).call(this.parentNode);
+}
+

0 comments on commit 6a9749d

Please sign in to comment.
Something went wrong with that request. Please try again.