Skip to content

Commit ccb363d

Browse files
committed
Add information about fullscreen iframes to README and demo
1 parent 0f92be3 commit ccb363d

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,12 @@ document. Example:
6969
$(document).bind("fullscreenerror", function() {
7070
alert("Browser rejected fullscreen change");
7171
});
72+
73+
74+
### Fullscreen iframe
75+
76+
Entering fullscreen mode from within an iframe is not allowed by default but
77+
it can be enabled with a few attributes on the iframe:
78+
79+
<iframe src="iframe.html" webkitAllowFullScreen mozAllowFullScreen allowFullScreen>
80+
</iframe>

demo/iframe.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Test iframe</title>
6+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
7+
<script type="text/javascript" src="../jquery.fullscreen-min.js"></script>
8+
</head>
9+
<body style="background:white">
10+
<button onclick="$(document).fullScreen(true)">Enter Fullscreen mode from iframe</button>
11+
<button onclick="$(document).fullScreen(false)">Exit Fullscreen mode</button>
12+
</body>
13+
</html>

demo/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ <h1>jQuery Fullscreen Plugin demo</h1>
4242
<button onclick="$(document).toggleFullScreen()">Toggle Fullscreen mode (Document)</button><br />
4343
<button onclick="alert($(document).fullScreen())">Query Fullscreen mode</button>
4444
</div>
45+
<iframe src="iframe.html" width="512" height="100" webkitAllowFullScreen mozAllowFullScreen allowFullScreen>
46+
</iframe>
4547
<p class="fullscreen-supported">
4648
Browser supports fullscreen mode.
4749
</p>
4850
<p class="fullscreen-not-supported">
4951
Browser does not support fullscreen mode.
50-
</p>
52+
</p>
5153
<p id="status"></p>
5254

5355
</body>

0 commit comments

Comments
 (0)