Add fullscreen mode
Handling the fullscreen functionality via the fullscreen JavaScript API. Press »f« on the keyboard to enter fullscreen mode.
This commit is contained in:
parent
c34be2e976
commit
2869f8a4ee
22
js/reveal.js
22
js/reveal.js
|
@ -435,6 +435,8 @@ var Reveal = (function(){
|
||||||
case 13: isOverviewActive() ? deactivateOverview() : triggered = false; break;
|
case 13: isOverviewActive() ? deactivateOverview() : triggered = false; break;
|
||||||
// b, period
|
// b, period
|
||||||
case 66: case 190: togglePause(); break;
|
case 66: case 190: togglePause(); break;
|
||||||
|
// f
|
||||||
|
case 70: enterFullscreen(); break;
|
||||||
default:
|
default:
|
||||||
triggered = false;
|
triggered = false;
|
||||||
}
|
}
|
||||||
|
@ -1192,7 +1194,25 @@ var Reveal = (function(){
|
||||||
// another timeout
|
// another timeout
|
||||||
cueAutoSlide();
|
cueAutoSlide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handling the fullscreen functionality via the fullscreen API
|
||||||
|
* @see http://fullscreen.spec.whatwg.org/
|
||||||
|
* @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
|
||||||
|
*/
|
||||||
|
function enterFullscreen() {
|
||||||
|
var element = document.body;
|
||||||
|
|
||||||
|
// Check which implementation is available
|
||||||
|
var requestMethod = element.requestFullScreen ||
|
||||||
|
element.webkitRequestFullScreen ||
|
||||||
|
element.mozRequestFullScreen ||
|
||||||
|
element.msRequestFullScreen;
|
||||||
|
if (requestMethod) {
|
||||||
|
requestMethod.apply(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Expose some methods publicly
|
// Expose some methods publicly
|
||||||
return {
|
return {
|
||||||
initialize: initialize,
|
initialize: initialize,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user