css 全屏API - HTML5 API - http://www.starstormdesign.de/fullscreen-api-html5/
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 全屏API - HTML5 API - http://www.starstormdesign.de/fullscreen-api-html5/相关的知识,希望对你有一定的参考价值。
if (
document.fullscreenEnabled ||
document.webkitFullscreenEnabled ||
document.mozFullScreenEnabled ||
document.msFullscreenEnabled
) {
// Das API ist verfügbar.
}
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();
}