JavaScript/사용자함수
[JavaScript][사용자함수] 브라우저 F11 전체화면 체크
힘없는염소
2017. 2. 13. 17:03
// F11키 이벤트 체크$(document).keydown(function(event) {if(event.keyCode == 122) {event.preventDefault();console.log("F11 click"); // F11키 클릭}});
// 윈도우 resize이벤트를 통한 전체화면 여부 체크$(window).on('resize', function() {if(screen.width === window.innerWidth && screen.height === window.innerHeight){console.log("full screen");} else {console.log("nomal screen");}});
반응형