웹 응용 프로그램에 전체 화면 모드로 작업 할 수있는 버튼이 있습니다. 내 문제는 현재 페이지에서만 작동한다는 것입니다. 링크를 클릭하거나 다른 방법으로 페이지를 변경하거나 현재 화면을 새로 고침해도 전체 화면 모드가 손실됩니다.페이지를 변경하거나 새로 고침 할 때 전체 화면이 표시되지 않습니다.
이있다 나는 전체 화면 수 있도록 사용하고 기능 :
// Handle full screen mode toggle
var handleFullScreenMode = function() {
// toggle full screen
function toggleFullScreen() {
if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
}
$('#trigger_fullscreen').click(function() {
toggleFullScreen();
});
}
$(document).ready(function() {
handleFullScreenMode();
});
당신이 F11를 클릭 할 때 발생하는 등의 페이지를 변경할 때 그것을 유지 어쨌든 거기를?
페이지 자체가 새로 고침됩니까? js를하지 않고보기에 머물러 있지 않습니까? –
페이지 리로드를 통해 쿠키 또는 localStorage/sessionStorage에 값을 저장하고 전체 화면 기능을 다시 적용하여 전체 화면 모드의 상태를 유지할 수 있습니다. – hindmost
@hindmost으로 특정 수준까지만 작동하지만 전체 화면 기능을 제거하는 것이 창의 크기를 항상 변경하는 것보다 더 좋습니다. 조금 실망스럽고 좌절감은 사용자가 내 응용 프로그램을 사용할 때 느껴지 길 바라는 것이 아닙니다. – FabioG