Skip to content

Instantly share code, notes, and snippets.

@bogomolov-dev
Created March 8, 2014 05:45
Show Gist options
  • Save bogomolov-dev/9425900 to your computer and use it in GitHub Desktop.
Save bogomolov-dev/9425900 to your computer and use it in GitHub Desktop.
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen,
:fullscreen {
/* Eigenschaften */
}
::backdrop,
::-ms-backdrop {
/* Eigenschaften */
}
document.addEventListener("fullscreenchange", fullscreenStatusChangedHandler);
document.addEventListener("webkitfullscreenchange", fullscreenStatusChangedHandler);
document.addEventListener("mozfullscreenchange", fullscreenStatusChangedHandler);
document.addEventListener("MSFullscreenChange", fullscreenStatusChangedHandler);
document.addEventListener("fullscreenerror", fullscreenErrorHandler);
document.addEventListener("webkitfullscreenerror", fullscreenErrorHandler);
document.addEventListener("mozfullscreenerror", fullscreenErrorHandler);
document.addEventListener("MSFullscreenError", fullscreenErrorHandler);
if(document.exitFullscreen) {
document.exitFullscreen();
} else if(document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.msExitFullscreen) {
document.msExitFullscreen();
}
var img = document.getElementById("my-image");
// Bild im Vollbild öffnen
if (img.requestFullscreen) {
img.requestFullscreen();
} else if (img.webkitRequestFullscreen) {
img.webkitRequestFullscreen();
} else if (img.mozRequestFullScreen) {
img.mozRequestFullScreen();
} else if (img.msRequestFullscreen) {
img.msRequestFullscreen();
}
if (
document.fullscreenEnabled ||
document.webkitFullscreenEnabled ||
document.mozFullScreenEnabled ||
document.msFullscreenEnabled
) {
// Das API ist verfügbar.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment