@@ -16,13 +16,13 @@ Usage
16
16
-----
17
17
18
18
### Entering Fullscreen mode
19
-
19
+
20
20
You can either switch the whole page or a single HTML element to fullscreen
21
21
mode:
22
-
22
+ ``` js
23
23
$ (document ).fullScreen (true );
24
24
$ (" #myVideo" ).fullScreen (true );
25
-
25
+ ```
26
26
This only works when the code was triggered by a user interaction (For
27
27
example a onclick event on a button). Browsers don't allow entering
28
28
fullscreen mode without user interaction.
@@ -33,10 +33,10 @@ fullscreen mode without user interaction.
33
33
Fullscreen mode is always exited via the document but this plugin allows
34
34
it also via any HTML element. The owner document of the selected HTML
35
35
element is used then:
36
-
36
+ ``` js
37
37
$ (document ).fullScreen (false );
38
38
$ (" #myVideo" ).fullScreen (false );
39
-
39
+ ```
40
40
41
41
### Querying Fullscreen mode
42
42
@@ -46,41 +46,41 @@ browser doesn't support this) when fullscreen mode is active, `false` if not
46
46
active or ` null ` when the browser does not support fullscreen mode at all.
47
47
So you can use this method also to display a fullscreen button only when the
48
48
browser supports fullscreen mode:
49
-
49
+ ``` js
50
50
$ (" #fullscreenButton" ).toggle ($ (document ).fullScreen () != null ))
51
-
51
+ ```
52
52
53
53
### Toggling Fullscreen mode
54
54
55
55
The plugin provides another method for simple fullscreen mode toggling:
56
-
56
+ ``` js
57
57
$ (document ).toggleFullScreen ();
58
-
58
+ ```
59
59
60
60
### Notifications
61
61
62
62
The plugin triggers a ` fullscreenchange ` event on the document when the
63
63
fullscreen mode has been changed. If the browser rejected a fullscreen
64
64
state change then the plugin triggers a ` fullscreenerror ` event on the
65
65
document. Example:
66
-
66
+ ``` js
67
67
$ (document ).bind (" fullscreenchange" , function () {
68
68
console .log (" Fullscreen " + ($ (document ).fullScreen () ? " on" : " off" ));
69
69
});
70
70
71
71
$ (document ).bind (" fullscreenerror" , function () {
72
72
alert (" Browser rejected fullscreen change" );
73
73
});
74
-
74
+ ```
75
75
76
76
### Fullscreen iframe
77
77
78
78
Entering fullscreen mode from within an iframe is not allowed by default but
79
79
it can be enabled with a few attributes on the iframe:
80
-
80
+ ``` html
81
81
<iframe src =" iframe.html" webkitAllowFullScreen mozAllowFullScreen allowFullScreen >
82
82
</iframe >
83
-
83
+ ```
84
84
### Known issues
85
85
86
86
* In IE 11 an empty page is displayed when entering fullscreen from within an
0 commit comments